PDF Editing Issues

How to Send a Filled PDF Form via Email as PDF Instead of XML

John WilsonJohn Wilson Nov 2, 2026 869 views

Question details

The user wants to configure a PDF form so that clicking the submit button emails the entire completed PDF document rather than extracting and sending only the XML data.

How to Send a Filled PDF Form via Email as PDF Instead of XML
Product
PDF Forms
Device & OS
not provided
Scenario
Designing or configuring a fillable PDF form with an email submission button.
Observed behavior
The default form submission behavior sends only the XML form data via email, requiring the recipient to manually import the data into a blank PDF to view it.
Before you start

Ensure you are using a PDF editor with advanced form creation capabilities and access to JavaScript properties or XFA XML source code before attempting to modify submission behaviors.

Solution 1Recommended

Use JavaScript to Set Submission Format to PDF

Add a custom JavaScript action to your form's submit button to explicitly dictate that the document sends as a full PDF.

By default, standard submit actions might default to FDF, XFDF, or XML to save bandwidth. Using a simple Acrobat JavaScript command forces the PDF reader to attach the whole document to the outgoing email.

1
Open form editing mode

Open your PDF form in your preferred PDF editor and enter Form Editing or Prepare Form mode.

2
Access button properties

Right-click the designated Submit button and select 'Properties' from the context menu.

3
Add JavaScript action

Navigate to the 'Actions' tab. From the 'Select Action' dropdown menu, choose 'Run a JavaScript', and then click the 'Add' button.

4
Enter the submit script

In the JavaScript Editor window, enter the following code: currentDoc.submitForm({cURL: "mailto:your-email@example.com?subject=Completed%20Form", cSubmitAs: "PDF"});

5
Save and test

Click 'OK' to close the editor, close the Properties window, save your PDF document, and click the button to test the email submission.

Use JavaScript to Set Submission Format to PDF
Correct Email Syntax: Be sure to replace 'your-email@example.com' with the actual destination email address. Use '%20' for spaces in the subject line.
Easy PDF Form Management

Create, Fill, and Share PDF Forms Easily with WPS Office

If you want to avoid complex JavaScript coding or XML modifications, WPS Office offers an incredibly straightforward way to handle PDF forms. With its robust built-in PDF tools, you can fill out forms and directly email them as standard PDF attachments with just a few clicks.

  1. 1. Open your PDF: Launch WPS Office and open your fillable PDF form.
  2. 2. Fill out the form: Click on the interactive fields to input your data directly within the intuitive PDF reader.
  3. 3. Save changes: Press Ctrl+S (or Cmd+S on Mac) to save the filled data into the PDF file.
  4. 4. Share via email: Click the 'Share' or 'Email' icon on the top toolbar to automatically open your default mail client with the completed PDF attached.
Native support for filling and saving interactive PDF formsDirectly share completed PDFs via email without needing custom scriptsHighly compatible with standard Adobe Acrobat PDF formatsLightweight, user-friendly interface for all your document needs
microsoft office alternative - wps office

Frequently Asked Questions

Why does my PDF form submit as XML by default?

Many PDF design tools default to XML or FDF formats because extracting and sending only the form data drastically reduces the file size. It also makes it easier for backend systems and databases to parse the submitted information automatically.

Can users with free PDF readers submit the form as a PDF?

Yes, if the form is properly configured with a JavaScript 'cSubmitAs: "PDF"' action, users with most standard free PDF readers can successfully click the button to generate an email with the filled PDF attached.

What if the email client doesn't open when the submit button is clicked?

This typically occurs if the user does not have a default desktop email client (like Microsoft Outlook or Apple Mail) configured on their operating system. In such cases, they will need to manually save the filled PDF and attach it to an email using their webmail interface.