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.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=213
Printed Date: 21 Sep 2019 at 6:30am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


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



Replies:
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 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net