Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-993

Image transparency lost when drawing an image (during pdf to image conversion)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.5.0
    • 1.6.0
    • None

    Description

      My scenario is converting an existing PDF to an image. When the PDF contains an image with transparency the transparency is lost and the image is drawn at 100% opacity.

      This fix is related (and depends on) the issue: https://issues.apache.org/jira/browse/PDFBOX-975

      All that is needed is to set the composite of the graphics before drawing the image as specified in the graphics state (See attached patch)

      Note: line number in patch maybe off since it was created from 1.5.0 but after fixing 975.

      Attachments

        1. pdf-with-transparent-image.pdf
          45 kB
          Jesse Eichar
        2. image-transparency-and-text.patch
          2 kB
          Jesse Eichar
        3. drawImageTransparency.patch
          2 kB
          Jesse Eichar
        4. before-fix.png
          360 kB
          Jesse Eichar
        5. after-fix.png
          314 kB
          Jesse Eichar

        Activity

          People

            lehmi Andreas Lehmkühler
            jeichar Jesse Eichar
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: