JavaScript - Split large PDF into separate files based on text inside PDF

New Here ,
Mar 01, 2019 Mar 01, 2019

Copy link to clipboard

Copied

I have Adobe Pro 11

I want to split a large Pdf file 2550 pages into multiple files with JavaScript.

The text '"Subtotal" only exists on these divider pages, so it can be used to identify where to split the document.

How easy would it be to create some javascript to run in an action which would do the following:

1. Identify text "Subtotal"

2. Split document at that point, saving the pages from current page (typically 5, though not always) up to page before next instance of "Subtotal"

Can this be done, or has it been done already? Thanks

TOPICS
Acrobat SDK and JavaScript, Windows

Views

2.1K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Mar 02, 2019 Mar 02, 2019
Yes, this sort of thing has already been done. Use the "doc.getPageNthWord()" function to find your keyword.  Then use the "doc.extractPages()" function to split out the pages.  Not difficult if you know how to program.   You can look up these functions in the Acrobat JavaScript Reference here:Acrobat DC SDK Documentation

Likes

Translate

Translate
Adobe Community Professional ,
Mar 02, 2019 Mar 02, 2019

Copy link to clipboard

Copied

LATEST

Yes, this sort of thing has already been done.

Use the "doc.getPageNthWord()" function to find your keyword.  Then use the "doc.extractPages()" function to split out the pages.  Not difficult if you know how to program.  

You can look up these functions in the Acrobat JavaScript Reference here:

Acrobat DC SDK Documentation

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines