PDF Editing Issues

Use a PDF Form Field as a Save Name in Adobe Acrobat

Phi Hung VoPhi Hung Vo Nov 19, 2026 868 views

Question details

Use values from PDF form fields to suggest or determine a saved file name in Acrobat.

Use a PDF Form Field as a Save Name in Adobe 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.
Before you start

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.

Solution 1Recommended

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.

1
Check the field name

Open the PDF in Acrobat, select All tools > Prepare a form, and check the name of the field whose value will be used.

2
Add an alert to the button

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.

3
Save with the suggested 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.

Show the suggested file name and enter it manually
The name is not filled in automatically: The alert displays the suggestion, but the user must type or paste it into the Save As dialog.
Free Microsoft Office alternative

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.

Open and work with PDF files alongside other documentsCompatible with Microsoft Office formats, including DOCX, XLSX, and PPTXFamiliar interface makes it easier to move from Microsoft OfficeFree, lightweight office suite
microsoft office alternative - wps office

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.