PDF Editing Issues

How to Submit Selected PDF Pages by Email using Acrobat JavaScript

Algirdas JasaitisAlgirdas Jasaitis Nov 5, 2026 870 views

Question details

The user wants to use Acrobat JavaScript to extract specific pages from a 30+ page PDF form and send only those selected pages via email.

How to Submit Selected PDF Pages by Email using Acrobat JavaScript
Product
Adobe Acrobat PDF
Device & OS
not provided
Scenario
Automating the email submission of a subset of pages from a large PDF form.
Observed behavior
The default submitForm script attaches the entire 30+ page document, instead of creating and sending a smaller document with only the required pages.
Before you start

Verify whether your form will be used primarily in Adobe Acrobat or Adobe Reader, as creating temporary documents via JavaScript requires specific security permissions and extended usage rights that differ between the two applications.

Solution 1Recommended

Use Acrobat JavaScript to Extract Pages and Submit

Write a custom script that creates a temporary document, copies the desired pages into it, and then emails that newly created file.

This method involves using JavaScript to dynamically generate a new PDF containing only the pages you specify before invoking the submit action. It requires Acrobat Pro or Standard because the extractPages function is restricted by default in the free Adobe Reader.

1
Open Form Preparation

Open your PDF form in Adobe Acrobat and enter 'Prepare Form' mode from the Tools menu.

2
Add a Submission Button

Add a new button to your document. Right-click the button and select 'Properties'.

3
Assign a JavaScript Action

Navigate to the 'Actions' tab, select 'Run a JavaScript' from the Select Action dropdown, and click 'Add'.

4
Write the Extraction Script

In the JavaScript Editor, write code that uses the extractPages() method to create a temporary document, and then calls the submitForm() method on that new document to attach it to an email.

Adobe Reader Limitations: Extracting pages via JavaScript is restricted in the free Adobe Reader. If your recipients use Reader, you must enable specific Reader Extension rights beforehand, or consider exporting just the form data (FDF/XML) instead of the whole file.
Easy PDF Extraction

Extract and Email Selected PDF Pages Easily with WPS PDF

If writing complex JavaScript code is not feasible, you can quickly extract specific pages from large documents and email them directly using the intuitive, built-in tools of WPS Office.

  1. 1. Open the PDF File: Launch WPS Office and open your large PDF document.
  2. 2. Access the Extract Tool: Navigate to the 'Page' tab on the top ribbon and select 'Extract Page'.
  3. 3. Select Pages to Extract: Specify the exact page range you wish to email and click 'Extract' to instantly create a new, smaller PDF.
  4. 4. Share via Email: Click the 'Menu' button and choose 'Share' or 'Email' to automatically attach the newly created document to your default email client.
No JavaScript or advanced coding knowledge required.Easily select and extract specific pages from large, multi-page PDFs.Fully compatible with standard Adobe PDF formats and forms.Lightweight and fast alternative for daily PDF editing and sharing tasks.
microsoft office alternative - wps office

Frequently Asked Questions

Can I use the submitForm JavaScript function in Adobe Reader?

Standard Adobe Reader has restricted security policies. While basic submitForm actions work, complex scripts like extractPages are usually blocked unless the document has been specifically 'reader-extended' using Acrobat Pro.

Is there a way to only send the filled form data instead of the entire PDF file?

Yes, you can modify the submitForm parameters to export only the form fields as an FDF, XFDF, or XML file. This greatly reduces the attachment size and does not require extracting pages.

Why does my PDF form fail to attach to an email when I click the submit button?

This often occurs due to email client incompatibility or security settings blocking JavaScript execution. Ensure your default desktop email client (such as Outlook) is properly configured to accept MAPI requests from your PDF software.

Can I extract specific PDF pages without paying for Adobe Acrobat?

Yes, you can use powerful alternatives like WPS PDF, which includes an intuitive 'Extract Pages' tool. This allows you to split documents and pull out necessary pages visually without needing to write any custom JavaScript code.