How to Batch Rename PDF Invoices Using OCR Data in Acrobat
Question details
The user wants to automatically extract data like invoice numbers and dates from PDF invoices using OCR, and use that extracted data to batch rename the files in Acrobat Pro.

- Product
- Adobe Acrobat Pro
- Device & OS
- not provided
- Scenario
- Processing a batch of newly added PDF invoices to extract key fields via OCR and rename the files according to a standardized naming convention.
- Observed behavior
- Acrobat Pro's built-in Scan and OCR tool can batch-process files but cannot natively use extracted OCR text to overwrite and rename the original files directly.
Ensure all your PDF invoices are gathered in a single local folder and that they have clear, legible text for the best OCR accuracy before running any batch scripts.
Use Acrobat Action Wizard and JavaScript to Extract Text and Save Copies
Utilize Acrobat's Action Wizard combined with custom JavaScript to run OCR, extract specific words, and save the documents as new files.
Acrobat cannot natively rename the original file currently open in the application. However, you can write a JavaScript macro to extract text using methods like doc.getPageNthWord() and save a new copy of the file with the desired name.
Open Adobe Acrobat Pro, navigate to the 'Tools' menu, and select 'Action Wizard'.
Click 'New Action' in the toolbar to create a custom batch process for your invoice folder.
Under 'Choose tools to add', select 'Recognize Text' and add it to your action steps to ensure the invoices are fully searchable.
Add an 'Execute JavaScript' step from the 'More Tools' section. Insert your custom script to locate the invoice number and use the 'saveAs' method to export the document as a newly named file.

Combine Acrobat with External Automation Tools
Leverage external tools or scripts to handle the file renaming process after Acrobat performs the OCR.
Manage and Process PDF Invoices Easily with WPS Office
While setting up complex JavaScript in Acrobat can be challenging, WPS Office provides intuitive, built-in PDF tools. With powerful OCR capabilities, you can quickly convert scanned invoices into editable text or Excel spreadsheets, making data extraction and file management significantly more straightforward.
- 1. Open PDF in WPS: Launch WPS Office and open your scanned invoice document in the WPS PDF reader.
- 2. Access OCR Tools: Navigate to the 'Tools' tab on the top ribbon and click on the 'OCR' button to recognize the text in your document.
- 3. Extract or Convert: Choose to extract the plain text directly from the screen, or select 'PDF to Excel' to convert the invoice data into a structured spreadsheet for easy tracking.

Frequently Asked Questions
Can Adobe Acrobat batch rename files natively without scripts?
No, Adobe Acrobat does not have a native, built-in feature to batch rename files using text extracted from the document. It requires custom JavaScript to save copies under new names or third-party renaming utilities.
Why does Acrobat save a copy instead of renaming the original file?
Acrobat's security and scripting architecture prevents it from modifying the filename of the active document that is currently open. Scripts can only use the 'saveAs' function to create a distinctly named copy in a specified directory.
What is the best way to extract specific data like invoice numbers from a PDF?
For complex layouts, using OCR to make the text readable, followed by pattern matching (such as Regular Expressions) in a script or utilizing dedicated invoice processing software, is the most reliable method to accurately locate and extract varying invoice numbers.




