How to Save a Completed Acrobat PDF Form with a Generated Filename
Question details
The user wants to configure a PDF button to automatically save a completed form to a dynamically generated folder path and filename based on the input from specific form fields.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Automating the file saving process of a filled PDF form using JavaScript to ensure standardized naming conventions.
- Observed behavior
- Acrobat JavaScript restricts scripts from creating new folders or silently saving files to arbitrary locations without elevated trusted privileges.
Ensure that the destination folder already exists on your local drive, as Acrobat JavaScript cannot automatically create new directories due to strict security restrictions.
Use the Standard Save As Workflow
This is the safest method for distributing forms to multiple users without needing to install privileged scripts on each individual computer.
Standard Acrobat JavaScript cannot silently save a file or create folders due to security limits designed to protect users from malicious scripts. Instead of silently saving the file, you can construct the filename and rely on the user to finalize the save action.
Use standard PDF JavaScript to pull values from your form fields (e.g., this.getField('ClientName').value).
Concatenate the extracted field values to form your desired filename string within the script.
Because silent saving is restricted, configure the form button to alert the user with the suggested filename, and instruct them to use the 'File' > 'Save As' menu to manually navigate to the pre-existing folder and paste the suggested name.

Implement Silent Saving via Trusted Scripts
For internal environments where you have control over the user's computer, you can install a folder-level script to grant trusted privileges for silent saving.
Manage PDFs and Office Documents with WPS Office
If managing complex Acrobat JavaScript security permissions is too cumbersome for your daily workflow, consider using WPS Office. It provides a lightweight, easy-to-use PDF editor alongside a complete suite of productivity tools for handling everyday documents without the hassle.

Frequently Asked Questions
Can a PDF JavaScript create a new folder on my computer?
No. Acrobat JavaScript has strict security restrictions that prevent scripts from creating new folders or directories. The destination folder must already exist on the local drive before attempting to save the file.
Why does my PDF form ask for permission when trying to save automatically?
Scripts that attempt to silently save files require elevated privileges to prevent malicious activities. Without a locally installed trusted script (.js file) on the computer, the application blocks the action and prompts the user to ensure security.
How do I dynamically generate a filename from PDF form fields?
You can use standard JavaScript in your PDF button properties to read field values (using this.getField('FieldName').value) and concatenate them into a single text string. However, automatically saving the file with this string requires either trusted folder-level scripts or manual 'Save As' actions by the user.




