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

qpdf: gradient with non-constant alpha renders black in acrobat

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 5.6.0
    • GUI: Painting
    • None

      linear gradient background which has stops with different alpha component is saved to pdf (qpdf.cpp) as SMask with /S /Alpha which is not interpreted correctly by acrobat, instead it renders the black box.

      I found that changing to /S to /Luminosity and switching transparency Group's color space to DeviceGray fixes the issue
      {{
      19 0 obj
      <<
      /SMask <<
      -/S /Alpha
      +/S /Luminosity
      /G 18 0 R
      >>
      >>
      @@ -225,6 +225,7 @@
      /BBox [ 0 0 1280 600 ]
      /Group <<
      /S /Transparency
      +/CS /DeviceGray
      >>
      /Resources <<
      /Shading <<
      }}

      probably duplicates QTBUG-36301 "Export painting in pdf or svg file, can't draw line with lineargradient pen."

      (edited related issue)

        1. gradient-3.html
          0.6 kB
        2. out-fixed.pdf
          20 kB
        3. out.pdf
          20 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            sletta Gunnar Sletta
            zowers Alexander Petrov
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes