PDF Editing Issues

How to Split a PDF at Specific Words in Adobe Acrobat

Bushra ParveenBushra Parveen Oct 28, 2026 868 views

Question details

The user needs to split a large PDF document dynamically whenever a specific word (such as "Invoice") appears, and automatically name each newly created file using the corresponding text (like the invoice number) that follows it.

How to Split a PDF at Specific Words and Automatically Name Output Files
Product
Adobe Acrobat
Device & OS
not provided
Scenario
Automating a content-based document workflow to separate a bulk PDF file into individual documents based on keyword triggers, then saving them with unique identifiers found within the text.
Observed behavior
Standard built-in tools in Adobe Acrobat do not support content-based splitting and automatic file renaming, requiring a custom scripted solution.
Before you start

Ensure you have access to a PDF editor that supports JavaScript execution, such as Adobe Acrobat Pro. Back up your original large PDF file before running any automated scripts to prevent accidental data loss or document corruption.

Solution 1Recommended

Use Custom Acrobat JavaScript to Extract and Rename Pages

Create and execute a custom JavaScript within Acrobat to iterate through the document text, identify target words, extract the specific page ranges, and auto-name the output files.

Because standard PDF editors lack a built-in 'split by text' button, you must use Acrobat JavaScript to automate this workflow. The script will search the document's text content for your target word (e.g., 'Invoice'), identify the page numbers where the word appears, extract the page ranges between matches, and save them using the adjacent text (like the invoice number).

If you do not have experience writing Acrobat JavaScript, you can adapt existing scripts like the 'Extract PDF Pages Based on Content' action available in developer forums, or consult a professional to build a custom tool.

1
Open Document JavaScripts

Launch Adobe Acrobat Pro and open your large PDF document. Go to 'Tools' > 'JavaScript' and select 'Document JavaScripts', or open the Action Wizard to create a new custom action.

2
Implement the Search Logic

Write a script utilizing the `getPageNumWords` and `getPageNthWord` API methods. Set up a loop to iterate through every word in the document to detect your target keyword and the numeric value following it.

3
Extract Page Ranges

Once the script identifies the start and end pages for a specific section, use the `extractPages` method to pull those specific pages into a new temporary document object.

4
Save and Auto-Name

Apply the `saveAs` method to the newly extracted document object, passing the previously identified text (e.g., the invoice number) as the new file name parameter.

5
Execute the Script

Run the script to process the entire PDF. The system will automatically generate and save the split files into your designated local directory.

Use Custom Acrobat JavaScript to Extract and Rename Pages
Scripting Knowledge Required: Writing and modifying this script requires familiarity with the Acrobat JavaScript API. Logic modifications are necessary depending on your document's exact layout and text structure.

Split and Manage PDF Pages Easily with WPS Office

While automated content-based splitting requires complex JavaScript coding, WPS Office provides a highly intuitive, visual PDF Split feature. You can effortlessly extract, split, and reorganize pages without needing to write a single line of code.

  1. 1. Open Your PDF: Launch WPS Office and open the PDF document you wish to split.
  2. 2. Access the Split Tool: Navigate to the 'Page' tab located on the top menu bar and click on the 'Split PDF' button.
  3. 3. Choose Split Method: In the dialog box, select your preferred splitting method, such as splitting by a specific page range or by a set maximum number of pages per file.
  4. 4. Set Output Location: Click the 'Browse' or 'Output Directory' button to choose exactly where the newly split files should be saved on your computer.
  5. 5. Execute Split: Click the 'Split' button to instantly generate your new, separate PDF files.
Easily split and extract PDF pages using a simple, visual interface.Fully compatible with standard PDFs and Microsoft Office formats (Word, Excel, PowerPoint).No programming or custom JavaScript required for structural document splitting.Lightweight, fast, and features a user-friendly interface for seamless document management.
microsoft office alternative - wps office

Frequently Asked Questions

Can I split a PDF by bookmarks instead of searching for specific text?

Yes, many advanced PDF editors allow you to split a PDF document based on top-level bookmarks. This is often an easier, built-in alternative to text-based scripting if your document already contains structural bookmarks for each section.

Is there a built-in feature to name extracted PDF files automatically?

Most standard split features will automatically append a sequential number (e.g., Part 1, Part 2) to the original file name. To dynamically name them based on specific document text (like an invoice number), you must use a custom script or specialized batch processing software.

Why doesn't the standard 'Extract Pages' tool read my document text?

The built-in 'Extract Pages' tool relies on structural document data like page numbers or visual user selection. It does not scan or interpret the textual content of the pages, which is why a custom JavaScript search function is required to identify specific words.

What if I don't know how to write Acrobat JavaScript?

If you lack JavaScript experience, you can search for pre-made scripts online (such as the 'Extract PDF Pages Based on Content' action), hire a developer to build a custom tool, or utilize dedicated third-party invoice processing software that features Optical Character Recognition (OCR) and auto-routing.