How to Create a PDF Signature Field to Email, Save, and Reset Forms
Question details
The user needs to configure a PDF signature field that, upon being signed, automatically emails the completed form, prompts the user to save a copy, and resets the original form for the next user.

- Product
- PDF Editor
- Device & OS
- not provided
- Scenario
- Creating a reusable PDF form for multiple customers that streamlines the submission process through automated emailing, saving, and form resetting after a digital signature is applied.
- Observed behavior
- The user is looking for the exact mechanism or script to apply to a signature field to automate the post-signing workflow and ensuring the blank form remains ready for the next customer.
Ensure you are using a professional PDF editor that supports JavaScript execution and verify that a default desktop email client is configured on the machine where the form will be signed.
Use Custom JavaScript in the Signature Field Properties
Add a specific JavaScript code block to the 'Signed' tab of the signature field to trigger the email, save, and reset actions simultaneously.
This method requires adding an action script directly to the digital signature field's properties. By chaining a few specific JavaScript commands, the PDF will automatically open the user's default email client, clear the active form fields, and trigger a 'Save As' dialog so the document is saved as a new file rather than overwriting the blank original.
Open your PDF form in edit mode. Double-click the digital signature field you want to modify to open the 'Signature Properties' dialog box.
Click on the 'Signed' tab within the properties window. Select the option that says 'This script executes when the signature field is signed'.
Enter the following code into the script editor: this.mailDoc({cTo: "me@server.com"}); this.resetForm(); app.execMenuItem("SaveAs");
Replace "me@server.com" in the script with the actual email address where you want the completed PDF forms to be sent.
Close the properties window and save the PDF. Test the document by signing it to ensure it successfully launches your email client, opens the Save As dialog, and resets the form fields.

Easily Create and Manage Interactive PDF Forms with WPS Office
WPS Office offers a comprehensive suite of PDF tools that simplify the process of creating fillable forms, adding digital signatures, and managing document workflows. It provides an intuitive interface for customizing form fields without the steep learning curve of other expensive PDF software.
- 1. Open your PDF: Launch WPS Office and open the PDF document you want to convert into an interactive form.
- 2. Access Form Tools: Navigate to the 'Form' tab on the top ribbon to access the interactive field options.
- 3. Add a Signature Field: Select the 'Signature' tool and drag a box onto your document where the user needs to sign.
- 4. Save and Distribute: Save your newly created fillable PDF form and share it with your clients for quick and easy signing.

Frequently Asked Questions
Will this JavaScript work if the user views the PDF in a web browser?
Most web browsers' built-in PDF viewers (like Chrome or Edge) do not fully support advanced PDF JavaScript features like 'mailDoc' or 'SaveAs'. For the script to execute correctly, the user must open the PDF in a dedicated desktop application like Adobe Acrobat or WPS PDF.
Why didn't the email send automatically after the document was signed?
The JavaScript 'mailDoc' function relies on the default desktop email client installed on the user's computer (such as Microsoft Outlook or Apple Mail). If the user strictly relies on web-based email (like Gmail in a browser) and has no desktop client configured, the automated email action will fail.
Does a standard PDF editor license support this level of automation?
Yes, standard versions of professional PDF editors generally support adding and executing basic JavaScript commands for actions like emailing, printing, and resetting forms. However, local security settings may prompt the user to grant permission before the email is generated.




