How to delete an optional content group alongwith its content from pdf using pdfbox?
问题 I have implemented functionality to delete the layer from pdf, but the problem is that, the content that I had drawn on the layer, does not get delete.Here is the code that I am using to delete the layer: PDDocumentCatalog documentCatalog = doc.getDocumentCatalog(); PDOptionalContentProperties ocgProps = documentCatalog.getOCProperties(); PDOptionalContentGroup ocg = ocgProps.getGroup(markupLayerName); COSDictionary ocgsDict = (COSDictionary)ocgProps.getCOSObject(); COSArray ocgs = (COSArray