Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

New Here ,
Mar 01, 2019 Mar 01, 2019

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
6.7K
Translate
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

Community Expert , 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

Translate
Community Expert ,
Mar 02, 2019 Mar 02, 2019
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

Translate
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