How to Create Automatic PDF Filenames Using Acrobat Action Wizard
Question details
The user needs to configure Acrobat Action Wizard to automatically generate filenames based on the current date and time when saving scanned and OCR'd PDFs.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Automating the scanning, OCR, and saving process for multiple PDF documents to ensure unique, timestamped filenames.
- Observed behavior
- The user wants the system to automatically save files with a timestamp (e.g., 2018-05-06-164515) to a local folder to prevent filename collisions.
Ensure you have Adobe Acrobat Pro installed, as the Action Wizard and custom JavaScript execution features are not available in the standard Acrobat Reader.
Use JavaScript in Action Wizard to Generate Timestamped Filenames
Add a custom JavaScript execution step to your Action Wizard workflow to dynamically generate a filename using the current date and time.
By utilizing Acrobat's built-in util.printd function, you can format the current date and time into a precise string. Including seconds in your timestamp structure (e.g., YYYY-MM-DD-HHMMSS) significantly reduces the risk of overwriting files when processing documents in bulk.
Open Adobe Acrobat Pro and navigate to Tools > Action Wizard.
Click New Action to start fresh, or select an existing action that already includes your Scan and Recognize Text (OCR) steps.
From the left panel under More Tools, select Execute JavaScript and add it to your action steps immediately after the OCR process.
Click Specify Settings on the newly added JavaScript step and enter a script using util.printd("yyyy-mm-dd-HHMMss", new Date()) to format the current date and time.
Use the this.saveAs() method within the same script block to define the destination folder path and append your newly generated timestamp string as the file's name.

Scan, OCR, and Manage PDFs Easily with WPS Office
While Acrobat requires custom JavaScript for workflow automation, WPS Office offers an intuitive, accessible interface for scanning documents, performing OCR, and easily managing your PDF files without any coding required.
- 1. Open WPS PDF: Launch WPS Office and open your scanned document using the WPS PDF editor.
- 2. Perform OCR: Navigate to the Tools tab and click on the OCR button to convert your scanned document into editable or searchable text.
- 3. Save and Rename Document: Click Menu > Save As, choose your designated local folder, and enter your preferred date or time string as the filename to securely save your processed file.

Frequently Asked Questions
Can I use Acrobat Reader to run Action Wizard scripts?
No, the Action Wizard and advanced JavaScript execution capabilities are exclusive to Adobe Acrobat Pro. Acrobat Reader only allows basic document viewing and form filling.
What happens if two files are processed at the exact same second?
If your timestamp format only goes down to the second, processing two files simultaneously might cause a filename collision. You can mitigate this by adding a random number generator or a millisecond variable to your JavaScript output.
What is the util.printd function in Adobe Acrobat?
util.printd is a specific JavaScript method within the Acrobat API used to format standard JavaScript Date objects into readable strings, allowing you to quickly convert a standard date into formats like 'YYYY-MM-DD'.
Does WPS Office support automated JavaScript for PDF files?
WPS Office focuses on an accessible, user-friendly graphical interface for tasks like OCR and PDF editing. It does not natively support Adobe's proprietary Action Wizard JavaScript API for automated batch renaming.




