How to Send a Filled PDF Form via Email as PDF Instead of XML
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.

- 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.
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.
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.
Open your PDF form in your preferred PDF editor and enter Form Editing or Prepare Form mode.
Right-click the designated Submit button and select 'Properties' from the context menu.
Navigate to the 'Actions' tab. From the 'Select Action' dropdown menu, choose 'Run a JavaScript', and then click the 'Add' button.
In the JavaScript Editor window, enter the following code: currentDoc.submitForm({cURL: "mailto:your-email@example.com?subject=Completed%20Form", cSubmitAs: "PDF"});
Click 'OK' to close the editor, close the Properties window, save your PDF document, and click the button to test the email submission.

Modify XFA Form XML Source Code
If you are working with an XFA form designed in LiveCycle Designer, manually update the XML source code to change the output format.
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. Open your PDF: Launch WPS Office and open your fillable PDF form.
- 2. Fill out the form: Click on the interactive fields to input your data directly within the intuitive PDF reader.
- 3. Save changes: Press Ctrl+S (or Cmd+S on Mac) to save the filled data into the PDF file.
- 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.

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.




