[ 
https://issues.apache.org/jira/browse/PDFBOX-5149?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314275#comment-17314275
 ] 

Emmeran Seehuber commented on PDFBOX-5149:
------------------------------------------

I use PDFRenderer with my PdfBoxGraphics2D to "rerender" the PDFs and change 
certain aspects in the process. I.e. I do some kind of transformation on the 
PDF by rendering it.

For a simple example look 
[here|https://github.com/rototor/pdfbox-graphics2d/blob/master/graphics2d/src/test/java/de/rototor/pdfbox/graphics2d/PdfRerenderTest.java#L123].

Depending on what I want to do I want to preserve as much of the original PDF 
as possible. So I also try to preserve the PDShadings (this is the code using 
the clone utility). This works for most parts, only transparency groups get 
"messed up", because they are rasterized as bitmaps by the PDFRenderer. I have 
already thought about would could be done to avoid that, but did not yet find 
time do some prototyping on this. I would like to be able to use PDFRenderer -> 
PdfBoxGraphics2D to process a PDF without loosing anything (i.e. also 
preserving all images in their full colorspace etc.). This could be used for 
all different kind of things. E.g. optimizing image resolution for web 
publishing or even implement a full PrePress PDF transformation (i.e. changing 
all colorspaces to be the same target CMYK, reduce resolution of image if they 
are way above what the print machine can do and so on).

At the moment I use this to convert some seperation color shapes into forms for 
sleeve foils. I.e. if you have some printed wedding card with some gold foil on 
it, the gold foil is applied by an extra step. In this step the shape which 
should get gold is printed with a CMYK(1,1,1,1) color and then put through a 
sleeve foil machine which will put foil where the toner is on the paper. After 
this step the real content is printed on the card. I get one PDF which contains 
the pages including the seperation color, and I have to preprocess it to get a 
page with only the shape for the gold and a page with the "normal" colors of 
the page, but without the special color.

So in the long term I would really like to be able to clone objects into new 
documents. Maybe adding PDCloneableObject interface and let all stuff which can 
really be safe cloned into a new document be implemented by it? Or just 
renaming PDFCloneUtility into something like COSInternalCloner? So that nobody 
finds it if he not really knows what he wants?

> 3.0.0-RC1: PDFCloneUtility is no longer accessible
> --------------------------------------------------
>
>                 Key: PDFBOX-5149
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5149
>             Project: PDFBox
>          Issue Type: Bug
>    Affects Versions: 3.0.0 PDFBox
>            Reporter: Emmeran Seehuber
>            Priority: Major
>
> PDFCloneUtility is no longer accessible by default. This is low level 
> functionality, which is sometimes required and useful. PDFBox itself is low 
> level, so I don't see why you would restrict access to this. Also this API is 
> not really complicated nor unstable.
> For now I did a dirty workaround to access it (seeĀ 
> [here|https://github.com/rototor/pdfbox-graphics2d/commit/5986bc653f83b2c06e5218ac906b9a9bc75f724e#diff-2113e77a03390c0cf920587a642fe7693e5b3c8402de783223035a79e13c2209R1]).
>  I would rather like to get rid of this workaround soon.
> Other than that, PDFBox-Graphics2d seems to work fine with PDFBox 3.0.0-RC1. 
> I just released a 3.0.0-RC1 version of it.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to