PDF Editing Issues

How to Automatically Name Split PDF Files Using Text from Each Page

Huda QurayshiHuda Qurayshi Oct 28, 2026 869 views

Question details

The user needs to split a multi-page PDF document into individual files and automatically rename each resulting file based on specific text (e.g., an employee name) extracted from its corresponding page.

How to Automatically Name Split PDF Files Using Text from Each Page
Product
PDF Editors
Device & OS
not provided
Scenario
Splitting batch documents such as payslips, certificates, or invoices into separate files and assigning them personalized filenames automatically.
Observed behavior
Requires a programmatic or automated method to accurately extract selectable text from consistent locations on each page to use as the output filename during the splitting process.
Before you start

Ensure the text you intend to use for filenames is selectable and not part of a flattened image. If dealing with scanned documents, you must perform OCR (Optical Character Recognition) first to make the text machine-readable.

Solution 1Recommended

Use Custom Acrobat JavaScript to Split and Rename Files

Utilize a custom script within Adobe Acrobat to iterate through the document pages, extract specific text strings, and save them as individual files.

This approach requires the target text to be in a consistent location on every page and formatted predictably. Because standard PDF editors do not have this as a one-click feature, a custom JavaScript code is necessary to automate the text extraction and file saving process.

1
Prepare the Document

Open your multi-page PDF document in Adobe Acrobat Pro and verify that the names or desired text strings are selectable.

2
Access the Action Wizard

Navigate to the 'Tools' menu and select 'Action Wizard', or open the 'JavaScript Debugger' console to input custom commands.

3
Execute the Script

Run a custom JavaScript code designed to loop through the document's pages, use the 'getPageNthWord' method to extract the required text string based on its coordinates, and use the 'extractPages' method to save each page.

Use Custom Acrobat JavaScript to Split and Rename Files
Programming Knowledge Required: Writing and modifying the exact JavaScript code requires programming experience. You may need to consult a script developer to tailor the code to the exact layout and coordinates of your specific PDF document.
Efficient PDF Management with WPS Office

Easily Split PDFs and Extract Text with WPS PDF

While automated script-based renaming requires advanced programming skills, WPS Office provides an intuitive and highly efficient PDF toolkit. It allows you to accurately OCR scanned documents, smoothly split multi-page PDFs, and extract specific text without extensive technical knowledge.

  1. 1. Open the Document: Launch WPS Office and open your multi-page PDF file.
  2. 2. Access the Split Tool: Navigate to the 'Page' tab on the top ribbon and select the 'Split PDF' option.
  3. 3. Configure Splitting Preferences: Choose your desired splitting method, such as dividing by a set number of pages or custom page ranges, and click 'Split'.
  4. 4. Extract Text via OCR: If you need to quickly grab text for manual renaming, use the 'OCR' tool located under the 'Tools' tab to instantly convert page content into editable text.
Effortlessly split PDFs by specific page ranges, intervals, or bookmarksBuilt-in OCR technology to extract text accurately from scanned documentsFully compatible with standard Adobe PDF file formatsLightweight, user-friendly interface for faster document processing
microsoft office alternative - wps office

Frequently Asked Questions

Can I automatically rename split PDFs if the text is in different locations on each page?

Generally, no. Automated script-based extraction requires the text to be in a consistent location and format on every page so that the script can accurately locate the coordinates and use the string as a filename.

Do I need to perform OCR if my PDF was saved directly from a Word document?

No. If the PDF was exported natively from a word processor like Microsoft Word or WPS Writer, the text is already selectable and machine-readable. OCR is only required for scanned images or documents that have been flattened.

Are there free tools to split PDFs and auto-name them by text?

Standard free PDF readers usually do not support automated text-based renaming upon splitting, as this is considered an advanced enterprise feature. You typically need premium software with JavaScript support or dedicated automation plug-ins to achieve this.