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

Shape transparency not respected when exporting to image

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.6.0
    • Component/s: None

      Description

      When a pdf file has a shape that is drawn with a transparency value the transparency values are not respected when exported to image.

      I have attached a small patch that fixes this issue. The patch does not fully satisfy the PDF transparency model, for example only Alpha composition is used. But it covers the most common use-case of drawing shapes with a transparency value for fill and stroke.

      I have also attached a maven project that demonstrates the issue. It had a pdf with a shape in it that is semi transparent. Running the application (execute the runexample.sh script) will load that pdf and export it as an image. During the export (the output is a file called pdfAsImage) the transparency is lost.

      Compare the exported image and the original pdf to see the difference. PDF is in src/main/resources/...

        Attachments

        1. pdfbox-transparency.zip
          190 kB
          Jesse Eichar
        2. transparency.patch
          5 kB
          Jesse Eichar

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: