PDF Editing Issues

How to Split a PDF into Files Named from Invoice Numbers

Khadija KhanKhadija Khan Nov 3, 2026 869 views

Question details

The user wants to split a multi-page PDF of invoices and automatically name the resulting individual files using the invoice numbers printed on each page.

Product
PDF
Device & OS
not provided
Scenario
Processing a batch of invoices in a single PDF file and organizing them into individual files for record-keeping.
Observed behavior
Standard PDF split tools only divide the document by page count or file size and cannot automatically read page text to generate custom file names.
Before you start

Ensure your invoice PDF contains clear, extractable text rather than flattened images, as scripts and processing tools rely on readable text to identify invoice numbers.

Solution 1Recommended

Use a Custom JavaScript Action

Since standard PDF editors do not natively support dynamic naming based on page content, executing a custom JavaScript action is the most reliable method.

Advanced PDF editors allow you to run custom scripts that iterate through the document, read the text of each page, identify a specific pattern (like an invoice number), extract the page, and save it using that pattern.

1
Open your advanced PDF editor

Launch a PDF editor that supports custom action scripts and JavaScript execution.

2
Access the Action Wizard

Navigate to the Action Wizard, Tools menu, or JavaScript console within the application.

3
Insert the custom script

Write or import a JavaScript code snippet designed to loop through document pages, extract text matching your invoice number format using regular expressions, and execute the page extraction command.

4
Run the script

Execute the script on your batch invoice PDF to automatically split the document and save the outputs with the extracted invoice numbers.

Scripting Knowledge Required: This method requires basic knowledge of JavaScript and PDF API objects. If you are unfamiliar with scripting, you may need to consult a developer.
Efficient PDF Management

Split and Manage Your Invoice PDFs with WPS Office

While fully automated dynamic naming requires custom scripts, WPS Office provides a highly intuitive PDF toolkit to quickly split large invoice batches, extract text, and manage your documents seamlessly.

  1. 1. Open the PDF in WPS Office: Launch WPS Office and open your multi-page invoice PDF document.
  2. 2. Access the Split Tool: Navigate to the 'Page' tab on the top ribbon and click on 'Split PDF'.
  3. 3. Configure Split Settings: Set the tool to split the document every 1 page (if each invoice is a single page) and choose your preferred output directory.
  4. 4. Extract and Rename: Use the built-in text selection or OCR tool to quickly copy the invoice number from each newly split file and rename them accordingly.
Easily split multi-page PDFs into individual files by page rangeExtract text from PDFs to quickly copy and paste invoice numbersFully compatible with all standard PDF formats and Adobe filesLightweight, fast, and user-friendly interface
microsoft office alternative - wps office

Frequently Asked Questions

Can I split a PDF by invoice number without writing code?

Standard PDF editors do not support this natively. To do it without coding, you will need to purchase specialized batch processing software with zonal OCR or use a third-party plugin designed specifically for auto-renaming.

Why isn't the standard split tool extracting my invoice numbers?

Standard split tools only divide pages based on structural elements like page count, file size, or top-level bookmarks. They do not parse or read the actual text content on the page to generate file names.

Does WPS Office support splitting PDFs?

Yes, WPS Office includes a robust PDF editor that allows you to easily split multi-page PDFs by page count or specific custom page ranges.

What if my invoice numbers are in scanned images?

If your PDF is a scanned image rather than a text-based document, you must first perform OCR (Optical Character Recognition) to convert the image into searchable text before any script or tool can extract the invoice numbers.