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

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

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

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.6K

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

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

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

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

TOPICS
Acrobat SDK and JavaScript, Windows

Views

1.6K

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
Mar 01, 2019 0
Mar 02, 2019

Copy link to clipboard

Copied

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

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Mar 02, 2019 0