How to Add a Selected PDF as Pages to an Acrobat Form
Question details
The user wants to create an interactive button in a PDF form that allows respondents to select another PDF file and insert it as pages directly into the document.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Designing an interactive PDF form where users need to append their own multi-page PDF documents into the current page flow rather than attaching them as embedded files.
- Observed behavior
- The native form button requires the insertPages JavaScript method, which is restricted for security reasons and fails in Adobe Reader without folder-level scripts.
Verify that the end-users filling out the form have the full version of Adobe Acrobat installed, as standard Adobe Reader cannot execute the required page insertion scripts.
Configure the insertPages Method with Folder-Level JavaScript
Use a trusted folder-level JavaScript function to allow users with Adobe Acrobat to securely insert a PDF as pages.
Because inserting pages modifies the core structure of the PDF, Adobe imposes strict security restrictions on this action.
To bypass security warnings and allow a form button to execute the insertPages method, you must deploy a trusted folder-level JavaScript file on every user's computer.
Write a folder-level JavaScript file (.js) that defines a trusted function using app.trustedFunction. Inside this function, call the this.insertPages() method to bypass standard security restrictions.
Save the .js file into the Acrobat application's Javascripts folder on each user's computer so the application recognizes it as a trusted local script.
Open your PDF form in Adobe Acrobat. Go to 'Prepare Form' mode and add a Button field to the desired page location.
Right-click the button, select 'Properties', navigate to the 'Actions' tab, choose 'Run a JavaScript', and input a script that calls your trusted folder-level function.

Easily Insert and Merge PDF Pages with WPS Office
Instead of relying on complex folder-level JavaScripts and restricted form buttons, you can easily insert, merge, and organize PDF pages manually using the intuitive Page tools in WPS Office.
- 1. Open the PDF in WPS Office: Launch WPS Office and open your primary PDF document.
- 2. Navigate to the Page Tab: Click on the 'Page' tab in the top ribbon to access the visual page management tools.
- 3. Select Insert Pages: Click on 'Insert Pages' and choose 'From PDF' to browse and select the PDF file you want to append.
- 4. Configure Insertion Settings: Specify the exact location (e.g., after the current page or at the end of the document) and confirm to merge the pages instantly.

Frequently Asked Questions
Can Adobe Reader users insert pages using a form button?
No, standard Adobe Acrobat Reader does not support the insertPages method for modifying document structure. End-users must have Adobe Acrobat Pro or Standard installed to perform this action.
Why do I need a folder-level script for the insertPages method?
Adding or extracting pages poses security risks if triggered automatically by malicious files. A folder-level JavaScript creates a trusted environment, proving the user has authorized elevated privileges on their local machine.
Is there a way to attach a PDF instead of inserting it as pages?
Yes. You can use the importDataObject method in JavaScript to allow users to attach a file to the PDF form. This method works in Adobe Reader and requires fewer security bypasses than modifying the page structure.




