How to Batch Rename PDF Files Using Document Titles
Question details
The user needs to automatically rename a large batch of PDF files based on the 'Title' stored within each document's metadata.

- Product
- Adobe Acrobat Pro
- Device & OS
- not provided
- Scenario
- Organizing thousands of generic or improperly named PDF files by automatically applying their internal metadata titles as the new file names.
- Observed behavior
- Currently, files have generic names, and manually renaming them is impractical. The goal is to extract the metadata title and use it to rename the files automatically.
Always create a backup copy of your original PDF files before running any batch processing scripts, as missing metadata or invalid characters in document titles can cause errors during the renaming process.
Use Action Wizard and JavaScript in Adobe Acrobat Pro
Utilize the Action Wizard to run a custom JavaScript snippet that saves a copy of each PDF using its metadata title.
Adobe Acrobat Pro allows you to automate repetitive tasks across multiple files using the Action Wizard. By adding a simple JavaScript command to an Action, you can instruct the program to extract the 'Title' property from the document's metadata and use it to save a new file.
Note that due to file-handling restrictions, Acrobat cannot directly rename the original files in place. Instead, this method processes the batch and outputs newly named copies into your designated folder.
Launch Adobe Acrobat Pro, go to the 'Tools' tab, and select 'Action Wizard' from the list of available tools.
Click on 'New Action' in the toolbar. Under the 'Files to be Processed' section on the right, click 'Add Folder' and select the directory containing the PDFs you want to rename.
In the left pane under 'Choose tools to add', expand 'More Tools', select 'Execute JavaScript', and click the '+' icon to add it to your Action steps.
Click the gear icon (Specify Settings) next to the 'Execute JavaScript' step you just added. Paste the following code into the window: this.saveAs(this.path.replace(this.documentFileName, this.info.Title + ".pdf")); Then click 'OK'.
Click 'Save', name your Action (e.g., 'Batch Rename by Title'), and confirm. Finally, click on your newly created Action in the Action List and hit 'Start' to process the files.

Easily Manage PDF Documents with WPS Office
While complex batch scripting requires advanced software like Acrobat Pro, WPS Office provides a lightweight, highly compatible, and user-friendly PDF editor. You can easily read, edit, and modify PDF metadata properties without an expensive subscription.

Frequently Asked Questions
Why did the batch rename script fail on some of my PDFs?
The script typically fails if the PDF's internal metadata 'Title' is entirely blank, or if the title contains invalid filename characters like colons (:), slashes (/), or question marks (?).
Can I rename the original files instead of saving copies?
In Adobe Acrobat Pro, security and file-handling restrictions prevent JavaScript from directly renaming the active file while it is open. The 'saveAs' method safely creates correctly named copies instead.
How do I check or edit a PDF's document title metadata?
You can view or edit the document title by opening the PDF, navigating to File > Properties (or Document Properties), and looking under the Description tab for the 'Title' field.
Are there dedicated utility programs for batch renaming by PDF metadata?
Yes. If you prefer not to use JavaScript, there are third-party bulk file renaming utilities that can extract PDF metadata titles and directly rename the original files in your operating system without opening them in a PDF viewer.




