Copy link to clipboard
Copied
Hi,
I am creating a Highlight annotation. When you create this annotation automatically, as written in the documentation, an annotation of the Popup type is created. At some point, I need to delete the created annotation. In this case, I would like to delete the Popup annotation associated with the Highlight annotation. The documentation says that Highlight annotation is the parent of Popup annotations. How to find Popup annotation associated with her Highlight annotation?
Thanks
Convert the pdAnnot into a CosDict Object, then get the Popup Property. This can then be converted into a PDAnnot.
PDAnnotGetCosObj()
PDAnnotFromCosObj()
Do you have PDFCanOpener? This tool will be a huge help.
http://www.windjack.com/product/pdfcanopener/
Copy link to clipboard
Copied
All anotations have a "Popup" property in the annotation dict. This is an indirect reference to Popup annotation.
Copy link to clipboard
Copied
I have PDAnnot pdAnnot = PDPageGetAnnot (pdPage, i);
How can I get the "Popup" property in the annotation dict?
I did not find this in the API?
Copy link to clipboard
Copied
Convert the pdAnnot into a CosDict Object, then get the Popup Property. This can then be converted into a PDAnnot.
PDAnnotGetCosObj()
PDAnnotFromCosObj()
Do you have PDFCanOpener? This tool will be a huge help.
http://www.windjack.com/product/pdfcanopener/
Copy link to clipboard
Copied
Thanks. Everything worked out. True, I had to figure out how to get the Popup Property.
Just in case, I will give all code. Perhaps someone will come in handy.
CosObj cosObj = PDAnnotGetCosObj(pdAnnot);
CosObj cosObj1 = CosDictGet(cosObj, ASAtomFromString("Popup"));
PDAnnot pdAnnot1 = PDAnnotFromCosObj(cosObj1);