These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Identifying Annotation Type

Shirley_P
Registered: Oct 15 2006
Posts: 7

I want to delete all annotations of a particular type using javascript. The problem is, I don't know what type Acrobat considers these annotations to be! They were created with a third party plug in that we no longer use. Acrobat does recognize them. I can select and delete them individually and the Content Panel describes them under Annotations as DGAP:RedaxBox. Yes I have looked at the SDK, but there are dozens of different annotation types to try. I would be grateful for any tips on how to describe these annotations in javascript. I am using Acrobat Pro 9. I am a beginner in scripting.

try67
Expert
Registered: Oct 30 2008
Posts: 2399
Maybe you could post one of these files so we can have a look for ourselves.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Acrobat JavaScript only has 16 listed. Have you looked at the Acrobat JS API Reference to see how to access the annotation object and report about it?

For example:
// Acquire all annotations on the first page, and write information to the console.this.syncAnnotScan(); // make sure you access the updated annotationsvar annots = this.getAnnots({nPage:0,nSortBy: ANSB_Author,bReverse: true});console.show();console.println("Number of Annotations: " + annots.length);var msg = "%s in a %s annot said: \"%s\"";for (var i = 0; i < annots.length; i++)console.println(util.printf(msg, annots[i].author, annots[i].type,annots[i].contents));

You can revise the code to loop through all of the pages or any single page and you should be able to see if your annotation can be detected and what it's type is in Acrobat JavaScript.

George Kaiser