Print Page | Close Window

How to identify docs with Annotations?

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: JavaScript
Forum Description: Discussions relating to the use of JavaScript within PDF.
Printed Date: 21 Nov 2019 at 9:18am
Software Version: Web Wiz Forums 11.10 -

Topic: How to identify docs with Annotations?
Posted By: oald
Subject: How to identify docs with Annotations?
Date Posted: 15 Feb 2012 at 11:27am

I wonder if JavaScript can identify documents with Annotations and remove all of the annotations. I'd like to execute the JavaScript codes in "Advanced - Document Processing - Batch Processing" to process documents in batch.

I check the "JavaScript for Acrobat API Reference" and find that there are methods "getAnnot" and "addAnnot", I'm not sure if there is a method to remove the annotations.

Your help is really appreciated!

My Product Information:
Acrobat Pro 8.1.6, Windows

Posted By: BAlheit
Date Posted: 15 Feb 2012 at 5:44pm
You can use the method destroy of annotations.

Example of the Javascript Reference:

// Remove all "FreeText" annotations on page 0.
var annots = this.getAnnots({ nPage:0 });
for (var i = 0; i < annots.length; i++)
if (annots.type == "FreeText") annots.destroy();

Posted By: gkaiseril
Date Posted: 15 Feb 2012 at 7:10pm
You also need to look carefully at the annotations you are about remove. Formatted links are annotations.

Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 -
Copyright ©2001-2017 Web Wiz Ltd. -