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

Need automated method for dividing PDF into individual files

akennedy
Registered: Jan 25 2008
Posts: 2

I'm looking for an automated method to seperate a PDF file into individual files using a seperater page to name the new files.

For example:
My system will autoprint a batch of pages to a PDF printer port.
The PDF file has X pages (10 in this sample but varies) :
Page 1 Cover sheet
Page 2 Divider with ID#000123
Page 3 page one of 123's text
Page 4 page two of 123's text
Page 5 Divider with ID#000124
Page 6 page one of 124's text
Page 7 Divider with ID#000125
Page 8 page one of 125's text
Page 9 page two of 125's text
Page 10 page three of 125's text

I need to provide 3 files from above example:

000123.pdf (or .txt or .htm) with 2 pages
000124.pdf with 1 page
000125.pdf with 3 pages

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
There are two separate things your script needs to do. Find the text used to divide up the document, and then extract pages into separate files.

The second one is fairly easy. The Doc object has a method called "extractPages()". It's very easy to use.

The first task is a little more difficult, but not too bad. The Doc object also has a function called "getPageNthWord()". The Acrobat JavaScript Reference has an example of how to use it.

The all important Acrobat JavaScript Reference can be found at:

http://www.adobe.com/devnet/acrobat/

Click on the "Documentation Tab

You also might be interested in looking at these articles for tips on creating an Acrobat Automation script

http://www.acrobatusers.com/tech_corners/javascript_corner/tips/2006/folder_level_scripts/


http://www.acrobatusers.com/tutorials/2007/10/apply_security_with_js/

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