How to add an annotations and markups to an existing layer(optional content group) in a pdf?

227 Views Asked by At

I am able to add a layer(optional content group) to a pdf using LayerUtility class in pdfbox library. But, I am not able to find any way to add annotations to 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 add markups or annotation to an existing layer in pdf?

0

There are 0 best solutions below