Am 20.01.2017 um 01:42 schrieb John Planow:
I'm using PDFRenderer.renderImageWithDPI() to create an image from a
PDF with a print watermark. The rendered image includes the watermark
text. Is this expected/desired behavior?
Here are some additional details..
I'm using a 2.1.0 snapshot of PDFBox.
The test PDF (attached) has the watermark text in an Optional Content
Group. The dictionary for this OCG dictionary looks like this:
<</Usage <</Export <</ExportState/OFF>>
/View <</ViewState/OFF>>
/Print <</Subtype /Watermark
/PrintState /ON >>>>
/Type /OCG
/Name (watermark)>>
I've attached the resulting image as well (outputImage.jpg). This
doesn't seem like the correct behavior and I'd be happy to file an
issue and look into it, but I want to be sure this isn't intentional.
Your attachments didn't get through but I can guess what you mean... we
don't support the optional content groups while rendering, i.e.
conditional rendering. That's more like a new feature than a bug. Rather
advanced stuff. Yes create a new issue with your attachment(s) but don't
expect this to be done quickly.
Another problem is that rendering does not "know" whether it is printing
or viewing.
Tilman