PDF Editing Issues

How to Create a PDF Form File Name from First and Last Name Fields

John WilsonJohn Wilson Nov 5, 2026 869 views

Question details

The user wants to automatically generate a PDF file name using the entered "First Name" and "Last Name" fields upon form submission.

How to Create a PDF Form File Name from First and Last Name Fields
Product
PDF Forms
Device & OS
not provided
Scenario
Submitting a completed PDF form and needing the resulting file to be automatically named based on the user-entered data.
Observed behavior
Standard PDF editors do not have a built-in feature to automatically rename submitted PDFs using form field values when using a standard mail submission button.
Before you start

Determine whether your PDF form will be used internally within a controlled environment or distributed publicly, as this dictates the type of scripting solution you will need to implement.

Solution 1Recommended

Use a Server-Side Script for Public Form Distribution

The most reliable method for forms distributed to the general public is routing the submission through a server-side script to handle the renaming process.

By submitting the form data to a web server instead of directly emailing it via a mailto link, a server-side script (such as PHP, Python, or Node.js) can capture the specific field values, rename the PDF accordingly, and then email or store the file safely.

1
Set up a server script

Create a script on your web hosting server designed to receive PDF form data, parse the incoming file, and extract specific field values.

2
Configure the submit button

In your PDF editor's form preparation mode, set the form's 'Submit' button action to route to the URL of your server-side script instead of an email address.

3
Process and rename the file

Program the server script to concatenate the first and last name fields into a single string, save the incoming PDF with this new string as the filename, and forward it to your desired email inbox.

Use a Server-Side Script for Public Form Distribution
Best for General Audiences: This method works across general distributions and is compatible with most third-party and mobile PDF viewers, as the processing is handled entirely on the server.

Fill and Rename PDF Forms Easily with WPS Office

While fully automating file names requires complex server scripts, WPS PDF provides an intuitive interface to fill form fields and quickly save your document with a custom name without any coding.

  1. 1. Open the PDF Form: Launch WPS Office and open your interactive PDF form document.
  2. 2. Fill the Form Fields: Click on the form fields and type the necessary information into the 'First Name' and 'Last Name' sections.
  3. 3. Use the Save As Feature: Click on 'Menu' in the top-left corner of the WPS PDF interface and select 'Save As' from the dropdown list.
  4. 4. Rename and Save: In the dialog box, manually type the first and last name as your new file name, select your destination folder, and click 'Save'.
  5. 5. Share the Document: Use the built-in 'Share' or email feature in WPS Office to send the newly named PDF directly to the recipient.
Seamlessly fill interactive PDF forms without complex configurations.Easily rename, organize, and manage your PDF files.Fully compatible with standard PDF documents and Microsoft Office formats.Built-in sharing tools to email your newly named documents instantly.
QA img-9

Frequently Asked Questions

Why doesn't the standard email submit button rename my PDF?

Standard PDF viewers use the original filename by default when attaching a form to an email via a simple 'mailto:' submit action. They do not have built-in functionality to parse form fields and rename the file dynamically without advanced scripting.

Can I use standard document-level JavaScript inside the PDF to rename the file?

Document-level JavaScript cannot typically save or rename a file due to strict security restrictions in PDF readers. You must use a 'trusted' folder-level script installed directly on the local machine, which is why it only works in controlled internal environments.

Does automated form naming work on mobile PDF viewers?

Native automated renaming via local scripts does not work on most mobile viewers due to app security sandboxing. However, using a server-side script to handle the submission and renaming works across all devices, including mobile.