pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tilman Hausherr <THaush...@t-online.de>
Subject Re: How to add markups to an existing OCG in a pdf
Date Mon, 10 Apr 2017 15:58:28 GMT
Am 10.04.2017 um 15:34 schrieb vakul:
> Hi,
> I want to implement functionality to allow user to create layers(Optional
> content group). Then, allow them to select a layer and add markups, text to
> that layer. I have implemented the functionality to create layers using the
> LayerUtility class. But, I am not able to modify an existing layer.
> I tried to convert the PDOptionalContentGroup to PDPage by first converting
> PDOptionalContentGroup to COSDictionary and then creating the PDPage from
> the COSDictionary. Then making the changes in the PDPage. But this creates
> an invalid PDPage.
> So, how do I modify an existing layer(optional content group) in a pdf?

I don't see how this would be possible easily. Please open a file with 
PDFDebugger before and after adding optional content, so that you can 
see what is done. To modify one existing OCG you would have to modify 
inside the content stream (unless you only add stuff). PDF isn't made 
for editing. Why not store what you want in some extra format, and then 
create the PDF with this data after the user has decided what's wanted?


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

View raw message