Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How to find Popup annotation

Explorer ,
Feb 21, 2020 Feb 21, 2020

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

TOPICS
Acrobat SDK and JavaScript
1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 25, 2020 Feb 25, 2020

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/

 

Translate
Community Expert ,
Feb 21, 2020 Feb 21, 2020

All anotations have a "Popup" property in the annotation dict. This is an indirect reference to Popup annotation.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 24, 2020 Feb 24, 2020

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 25, 2020 Feb 25, 2020

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/

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 26, 2020 Feb 26, 2020
LATEST

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);

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines