How to Create a PDF Button to Save and Email a Form
Question details
The user wants to configure a button within an interactive PDF form that automatically saves the file to the local drive and submits it to a default email address.

- Product
- Adobe Acrobat / PDF
- Device & OS
- not provided
- Scenario
- Creating an interactive PDF form designed to let users easily fill, save, and email their completed submissions via a single button click.
- Observed behavior
- Strict security restrictions prevent a PDF from silently saving directly to a user's computer, stopping the automated workflow from functioning without trusted local scripts.
Before configuring your interactive buttons, be aware that modern PDF readers block silent background saving to protect users from malicious scripts. You will need to rely on explicit user prompts to save the file.
Trigger a 'Save As' Prompt Before Email Submission
Use JavaScript to prompt the user with a 'Save As' dialog manually before initiating the email submission process.
Due to security sandboxing, PDFs cannot automatically write files to a user's hard drive unless a trusted folder-level script is installed locally. The standard workaround is to script the button to open the 'Save As' dialog, forcing the user to save it before the email opens.
Open your PDF in form editing mode, select the Button tool from the interactive objects menu, and draw a button on your document.
Right-click the newly created button, select 'Properties', and navigate to the 'Actions' tab.
In the 'Select Action' dropdown, choose 'Run a JavaScript' and click the 'Add' button to open the JavaScript editor.
Enter a script that first executes the Save As menu item (e.g., using app.execMenuItem("SaveAs")) and then calls the this.mailDoc() method to generate the email attachment.

Use a Trusted Folder Script (For Internal Networks)
Deploy a trusted JavaScript file directly to the local machines of all users to bypass security prompts.
Edit and Manage PDF Forms Easily with WPS Office
WPS Office provides a comprehensive PDF editor that allows you to reliably fill out interactive forms, add text, and securely save or email your documents without worrying about complex scripting limitations. It serves as an excellent, lightweight suite for handling your daily PDF workflows.
- 1. Open your PDF form in WPS Office: Launch WPS Office and open your interactive PDF document using the built-in WPS PDF viewer.
- 2. Fill in the required fields: Click on the designated form fields to input your data. WPS PDF automatically highlights fillable areas for easy navigation.
- 3. Save the document securely: Click the 'Save As' icon in the top left toolbar to securely save a completed copy to your local drive.
- 4. Share via email: Click the 'Share' or 'Email' button on the top menu to attach your finalized PDF to a new message in your default email client.

Frequently Asked Questions
Why can't my PDF automatically save without prompting the user?
Modern PDF viewers implement strict security sandboxing to prevent malicious files from writing data to your hard drive without your explicit permission. Silent saving requires a trusted, locally installed script.
Can I force a user to save the PDF before they click the email submit button?
Yes, you can use JavaScript attached to the button to check the document's save status. If the file is unsaved or modified, the script can halt the email submission and trigger a 'Save As' dialog instead.
How do I submit a PDF form via email without using JavaScript?
You can use a standard Submit Form action in your button properties. Set the action to 'Submit a form' and enter a 'mailto:' URL (e.g., mailto:email@example.com). This will attach the raw form data or the PDF to an email draft, though it will not automatically save the file locally.




