Use a PDF Form Field as a Save Name in Adobe Acrobat
Question details
Use values from PDF form fields to suggest or determine a saved file name in Acrobat.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A PDF form button builds a file name from field values and calls the Acrobat JavaScript saveAs method.
- Observed behavior
- The generated file name does not automatically appear in the Save As dialog.
Check the exact names of the PDF form fields in Acrobat's Prepare a Form tool and confirm that Acrobat JavaScript is enabled in Preferences. If you need an automatic save, check whether an administrator can install a folder-level JavaScript file on the local computer.
Show the suggested file name and enter it manually
Use this approach when the PDF must work without a locally installed trusted script.
A script running in an unprivileged document context cannot force a file path or default name in the Save As dialog. Instead, show the generated name to the user, who can enter it when saving.
Open the PDF in Acrobat, select All tools > Prepare a form, and check the name of the field whose value will be used.
Open the button's Properties, select Actions, and add a Run a JavaScript action. For example, use: var name = this.getField("Customer").valueAsString; app.alert("Suggested file name: " + name + ".pdf"); Replace Customer with the actual field name.
Click the form button to view the suggestion, then choose Menu > Save as or File > Save As and enter the name in the file name box. Remove characters that your operating system does not allow in file names.

Use a trusted folder-level JavaScript function to save
Use this option when an administrator can deploy a local Acrobat script and an automatic save is needed.
Work with PDF and Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDF and Office files. Its format compatibility helps you move existing documents into WPS, although it does not fix Acrobat's saveAs security restrictions.

Frequently Asked Questions
Why doesn't my generated name appear in Acrobat's Save As dialog?
A document-level script running without privileges cannot force a file path or default save name. Display the suggested name with app.alert and let the user enter it in Save As.
Can a trusted function automatically save the PDF?
A locally installed folder-level trusted function can perform a privileged save to an approved path, subject to Acrobat's security restrictions. It does not necessarily fill in the standard Save As dialog.
How do I find the name of a form field?
In Acrobat, open the PDF and select All tools > Prepare a form. Inspect the field's properties and use its exact name in the getField call.
What should I do if a field value contains an invalid file-name character?
Remove or replace characters that the destination operating system does not allow before saving. For a trusted function, validate the name and restrict the destination folder in the local script.




