How to Use an Acrobat Submit Button to Rename and Save a PDF
Question details
The user needs to create a submit button within a PDF form that automatically generates a filename based on a fillable field's value and saves the document into a designated network folder.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating an automated fillable PDF form workflow where completed documents are instantly renamed according to user input (e.g., client name) and routed to a specific storage path.
- Observed behavior
- The user requires a custom JavaScript action attached to a form button to handle extraction of field data, construction of a new filename, and execution of a silent save to a network directory.
Ensure you have Adobe Acrobat Pro installed, as creating form buttons and configuring folder-level JavaScript for silent saving is restricted in standard PDF readers.
Use Acrobat JavaScript to Automate Renaming and Saving
Configure a submit button with a custom JavaScript snippet to read specific form fields, construct a new filename, and save the document using the saveAs method.
To automate the saving process, you can embed JavaScript into the button's properties. The script will retrieve the text value from a designated field, append it to a specific folder path, and execute the save command.
Keep in mind that automatic saving to a local or network path triggers security warnings. You must configure Acrobat's trusted locations or use folder-level scripts (trusted functions) to bypass security restrictions for silent saving.
Open your PDF in Acrobat's 'Prepare Form' mode. Note the exact name of the text field you intend to use for the new filename (for example, 'ClientName').
Add a new button to the form from the toolbar. Double-click the button to open the Button Properties dialog box.
Navigate to the 'Actions' tab. Select 'Mouse Up' as the trigger, choose 'Run a JavaScript' from the action dropdown menu, and click the 'Add' button.
In the JavaScript Editor, input the code to fetch the field value and trigger the save. Example: var fileName = this.getField('ClientName').value; this.saveAs('/C/NetworkFolder/' + fileName + '.pdf');
Since the saveAs function is restricted for security reasons, create a folder-level JavaScript file (.js) on the host machine containing a trusted function to allow saving without user prompts.

Easily Fill and Manage PDF Forms with WPS Office
While complex JavaScript actions in Acrobat require extensive configuration and security bypasses, WPS Office provides an intuitive, user-friendly PDF editor. You can seamlessly fill out PDF forms, rename them easily through standard save dialogues, and enjoy full compatibility with all your necessary document formats.
- 1. Open the PDF Form in WPS: Launch WPS Office and open your fillable PDF document.
- 2. Fill in the Required Fields: Click on the interactive form fields to input your data directly. WPS PDF clearly highlights fillable areas for easy navigation.
- 3. Save and Rename the File: Go to 'Menu' > 'Save As', navigate to your desired local or network folder, and type in the new filename based on your form data.

Frequently Asked Questions
Why does my Acrobat JavaScript saveAs function throw a security error?
Acrobat restricts silent saving and automated network access to prevent malicious actions. To resolve this error, you must execute the script through a trusted folder-level JavaScript file or manually adjust the trusted locations in the application's security preferences.
Can Acrobat Reader users execute a JavaScript submit button to save files?
By default, Acrobat Reader cannot execute the saveAs JavaScript method. The document must either be opened in Acrobat Pro, or it needs to have extended usage rights applied via a certified Adobe workflow.
How do I pull data from multiple form fields to create a single filename?
You can concatenate multiple values by declaring variables for each field in your JavaScript. For example: var fullName = this.getField('FirstName').value + '_' + this.getField('LastName').value; This concatenated string can then be appended to your file path.
What is the correct folder path format for Acrobat JavaScript?
Acrobat requires a device-independent path format. Instead of using standard Windows backslashes (like C:\folder\file.pdf), you must use forward slashes and specific drive notation, such as /c/folder/file.pdf.




