How to Save a PDF with a Name Taken from a Form Field in Acrobat
Question details
The user wants to configure a PDF form so that clicking a Save button automatically names the file using text entered into a specific form field, such as an applicant's name.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Creating a fillable PDF form and streamlining the file saving process to ensure standardized naming conventions for applicants.
- Observed behavior
- The built-in Save and Save As commands prompt for a manual filename and cannot automatically pull the desired name from the form fields.
Ensure you have Adobe Acrobat Pro or sufficient editing privileges to modify form fields and add Document JavaScripts. Note that advanced saving scripts require application-level trust to run securely on local computers.
Create a Custom Save Button Using Acrobat JavaScript
Since default save buttons cannot be modified, you must create a custom button that uses JavaScript to extract the form field value and trigger the save action.
You cannot natively change or rename the behavior of the built-in 'Save' or 'Save As' commands in Adobe Acrobat. To achieve automatic naming based on a form field, you need to create a custom button within the PDF.
This button will execute a JavaScript function to pull the field data and save the document. Keep in mind that for security reasons, scripts that silently save files to a local directory require a trusted function (folder-level script) to be installed on each user's computer.
Open your PDF form in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form'.
Click the 'Add a Button' icon in the toolbar, place it on your document, and double-click the button to open the Button Properties dialog.
Navigate to the 'Actions' tab, select 'Mouse Up' from the Select Trigger dropdown, choose 'Run a JavaScript' from the Select Action dropdown, and click 'Add'.
Input your custom code to define the file path and extract the field value (e.g., extracting the text using var fileName = this.getField('ApplicantName').value;). Click OK to save the script.
For the script to bypass security restrictions and save directly to a drive, create a trusted folder-level (.js) file and deploy it to the Acrobat JavaScripts folder on each user's local machine.

Edit, Fill, and Manage PDF Forms Easily with WPS Office
While advanced JavaScript automation in Acrobat can be highly complex and requires expensive licenses, WPS Office provides a free, lightweight, and user-friendly alternative for handling standard PDF forms, documents, and spreadsheets. With native support for filling out forms, adding signatures, and seamless document management, WPS Office ensures you can handle your paperwork effortlessly.
- 1. Download and Install: Download WPS Office for free from the official website and complete the quick installation process.
- 2. Open Your PDF Form: Launch WPS PDF and open your interactive PDF form directly within the application.
- 3. Fill and Save: Fill out the necessary form fields intuitively, and use the 'Save As' feature to securely store your completed document.

Frequently Asked Questions
Can I change the default Save As behavior in Adobe Reader?
No, the built-in Save and Save As commands are hardcoded in Adobe Reader and Acrobat. They cannot be modified to automatically pull file names from form fields. You must use a custom button with a JavaScript action instead.
Why isn't my PDF JavaScript save button working on other computers?
Scripts that automatically save files to a local hard drive require elevated privileges. You must install a folder-level (application-level) trusted script on each specific user's local machine for it to execute successfully without being blocked by Adobe's security sandbox.
Can I use this custom save script on a mobile device or web browser?
Custom JavaScripts for saving files generally do not work on mobile PDF viewers or web browser extensions due to strict sandbox security environments. Users must open the form in a fully-featured desktop PDF application like Adobe Acrobat.
Is there an easier way to collect form data without using custom scripts?
Yes, instead of saving individual files with dynamic names locally, you can use Acrobat's 'Submit a Form' action to automatically email the form data directly to a specified email address or server, bypassing the need for complex local save scripts.




