You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Henry Iguaro (Jira)" <ji...@apache.org> on 2021/11/05 03:40:00 UTC

[jira] [Created] (PDFBOX-5314) Additional `showTransparencyGroupOnGraphics()` method

Henry Iguaro created PDFBOX-5314:
------------------------------------

             Summary: Additional `showTransparencyGroupOnGraphics()` method
                 Key: PDFBOX-5314
                 URL: https://issues.apache.org/jira/browse/PDFBOX-5314
             Project: PDFBox
          Issue Type: New Feature
          Components: Rendering
            Reporter: Henry Iguaro
         Attachments: image-2021-11-05-14-36-13-097.png

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|https://github.com/apache/pdfbox/files/7457707/testing.pdf]:

!https://user-images.githubusercontent.com/2560573/139784518-b3f8965c-79a2-45d6-8200-62fa0e3c4459.png!

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

!https://user-images.githubusercontent.com/2560573/139784739-d7562053-0f11-4752-be7f-2ba6659d4816.png!

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

!image-2021-11-05-14-36-13-097.png!

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.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org