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?


Tilman


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

Reply via email to