Fix JavaScript EML Email Attachment Fails in Free Acrobat Reader
Question details
The user is trying to execute a JavaScript function inside a PDF form to generate and launch an .eml email attachment, but the script is unresponsive in the free version of Adobe Acrobat.

- Product
- Adobe Acrobat Reader
- Device & OS
- not provided
- Scenario
- Attempting to extract PDF form data and automatically launch the user's email client with an EML file attachment using embedded JavaScript.
- Observed behavior
- The script executes successfully in Acrobat Pro but does absolutely nothing when triggered in the free Adobe Acrobat Reader application.
Verify whether your end users are utilizing Adobe Acrobat Reader (the free version) or Adobe Acrobat Pro, as advanced JavaScript API permissions differ significantly between the two tiers.
Use Server-Side Workarounds Instead of Local JavaScript
Because the free Acrobat Reader blocks the creation of new data objects via JavaScript, you must rely on server-side processing to generate the email.
The free Acrobat Reader intentionally restricts certain advanced JavaScript methods for security and monetization purposes. Specifically, methods like `createDataObject` and `exportDataObject` are entirely disabled in Reader.
To resolve this issue for users without Acrobat Pro, you must change your form submission workflow so the email creation happens remotely rather than locally on the user's machine.
Open your PDF form in an editor and change the submit button's action from executing local JavaScript (EML generation) to submitting the raw form data (FDF, XML, or HTML) to a specified web URL.
Set up a backend script (using PHP, Node.js, Python, etc.) at your submission URL designed to catch the incoming POST request containing the PDF form data.
Program the web server to parse the submitted data and automatically generate and send the email with the necessary attachments, completely bypassing the free Acrobat Reader's local JavaScript limitations.

Try WPS Office for Comprehensive PDF Management
Tired of encountering premium paywalls and restricted features in free PDF readers? WPS Office offers a robust PDF editor alongside a complete suite of Word, Excel, and PowerPoint alternatives. It is lightweight, highly compatible with standard formats, and provides essential PDF reading, form-filling, and editing tools without the steep learning curve.

Frequently Asked Questions
Why does my PDF JavaScript work in Acrobat Pro but not in Reader?
Adobe intentionally restricts advanced JavaScript APIs, such as data object creation and certain export functions, in the free Reader version. These features require the premium Acrobat Pro license to execute correctly.
Can I use 'mailto:' in a PDF instead of creating an EML attachment?
Yes. You can configure a PDF submit button to use a standard 'mailto:' action to send form data. However, this relies on the user having a properly configured default desktop email client and will not generate a standalone EML file attachment.
Is there a way to enable `createDataObject` in Adobe Reader?
No. The `createDataObject` and `exportDataObject` JavaScript methods are hard-restricted in Adobe Reader. No security setting, registry edit, or user preference can bypass this limitation.




