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

Additional `showTransparencyGroupOnGraphics()` method

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.24
    • 2.0.25, 3.0.0 PDFBox
    • Rendering
    • None

    Description

      Hey team,

      In one particular feature of our product, we read PDF files (using PDFBox, of course) and extract graphical elements as individual images for our customers. However, when TGs are decoded, we end up with partial results. For example, given the following file:

      Ideally, our flow should extract its graphical content as an individual image:

      But after the TGs is decoded, the results we obtain with our current implementation are the following 3 separate images:

      We found out that if we manage to pass a particular Graphics2D instance to showTransparencyGroup() we can redirect the rendering of the TG to a separate image and achieve our feature.

      We created a PR as a potential proposal for a new protected showTransparencyGroupOnGraphics() method that would extend the current showTransparencyGroup() by taking an additional Graphics2D argument. The link to the PR is here:

      https://github.com/apache/pdfbox/pull/134

      The above is just a suggestion but keen to hear your thoughts, and of course, open to better ideas.

      Attachments

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              tyrannosaurus Henry Iguaro
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: