Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-68537

PDF export ignores the cosmetic attribute of QPen

XMLWordPrintable

    • b72a9cbaaf7d49a1813c3b1926a68e05f47f350a

      The PDF backend ignores the cosmetic attributes for certain pens.

      The attribute indicating, if a pen is cosmetic or not gets stored in QPdf::Stroker ( see qpdf.cpp line 655 ). But later in QPdfEngine::drawPath the stroker is not used, when the pen is regarded as "simple".

      According to qpdf.cpp line 1113 a pen is "simple", when the following conditions are met:

      (penBrush.style() == Qt::SolidPattern) && penBrush.isOpaque() && d->opacity == 1.0

      According to the code it is possible to get the cosmetic attribute being respected by setting the penBrush to something non opaque. And indeed setting a pen color with an alpha value of 254 worked in our tests.

      This bug also appears in earlier versions, maybe since the code was implemented.

        1. test.pdf
          2 kB
        2. main.cpp
          1.0 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            anrocha André De La Rocha (Inactive)
            uwe Uwe Rathmann
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes