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

Extract PDF pages with annotations only

antonyprince82
Registered: Nov 29 2010
Posts: 2

I would like to have a java script which will automatically extract (only) the PDF pages with annotations/comments and combine them into a single PDF (ascending page number order) and store it in a location. If possible also for a set of PDF documents in a particular folder.

My Product Information:
Acrobat Standard 8.0, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Yes, both of these things are possible. There is a JavaScript function for acquiring annotations on a per page basis, and there are functions for extracting and inserting pages. The idea is to write a script that loops through all the pages in a PDF and acquire the list of annots for each page. If the list is empty then go on to the next one, if it's got something in it, then extract/insert the page into a new PDF. This is an automation script so it will need to be either run from the console window, or you will need to place it in a folder level script file. You can look up both of these topics on this web site.

To do this for a folder of files you'll need to use Batch Processing, which is only available on Acrobat Pro. A Batch sequence is also a great place to put an Automation script.

Soon, there will be an Actions gallery on this site. Actions are the Acrobat X equivalent of Batch Processing. I've created one for the gallery that does exactly what you are asking about. Even though it's for AcrobatX, the script will work in previous versions of Acrobat, and in Standard.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script