PDF Editing Issues

How to Add and Delete Repeated PDF Pages Using Acrobat Page Templates

Jason MillerJason Miller Nov 2, 2026 869 views

Question details

The user wants to configure an interactive PDF form that allows end-users to dynamically add or remove repeated input pages by clicking dedicated buttons.

How to Add and Delete Repeated PDF Pages Using Acrobat Page Templates
Product
Adobe Acrobat Pro DC
Device & OS
not provided
Scenario
Creating dynamic and scalable PDF forms with repeatable sections using Acrobat Pro.
Observed behavior
Needs instructions on setting up Acrobat page templates and applying JavaScript commands to interactive form buttons for spawning and deleting pages.
Before you start

Ensure you have Adobe Acrobat Pro DC installed, as standard PDF readers do not support the creation of advanced JavaScript page templates. Finalize the design of your repeatable form page before configuring the template.

Solution 1Recommended

Use JavaScript and Hidden Page Templates in Acrobat Pro

Configure a specific document page as a hidden template and attach JavaScript actions to form buttons to control the spawning and deletion of that page.

Acrobat Pro DC allows you to designate a page as a reusable template. By leveraging Adobe's JavaScript API, you can map the 'spawnPageFromTemplate' and 'deletePages' methods to interactive buttons, giving users complete control over adding or removing form sections dynamically.

1
Create the Page Template

Open your document in Acrobat Pro. Navigate to 'Organize Pages', select the page you want to make repeatable, and click 'More' > 'Page Templates'. Name your template (e.g., 'RepeatPage'), click 'Add', and check the 'Hidden' icon if you do not want the source template to be visible to the user.

2
Configure the 'Add Page' Button

Go to the 'Prepare Form' tool and insert a Button field. Right-click the button, select 'Properties', and navigate to the 'Actions' tab. Select 'Run a JavaScript' from the 'Select Action' dropdown and click 'Add'.

3
Insert the Template Spawning Script

In the JavaScript Editor, type a script to spawn the page. For example: var expTplt = getTemplate('RepeatPage'); expTplt.spawn({nPage: pageNum, bRename: true, bOverlay: false}); Click OK to save the action.

4
Configure the 'Delete Page' Button

Add a second button for deletion. In its 'Actions' tab, select 'Run a JavaScript' and enter a script such as: if (numPages > 1) { deletePages(pageNum); } Ensure you add logic to prevent deleting the final remaining page of the document.

5
Test the Document

Save the PDF and switch to Preview mode or open it in Adobe Acrobat Reader. Click the buttons to verify that the pages are successfully added and removed.

Use JavaScript and Hidden Page Templates in Acrobat Pro
Browser Limitations: JavaScript template actions require a dedicated desktop PDF viewer. They typically will not function correctly if the user opens the PDF in a web browser like Chrome or Edge.
Free Microsoft Office alternative

Easily Manage PDF Pages and Office Documents with WPS Office

While dynamic JavaScript template spawning is a highly specific feature of Adobe Acrobat Pro, WPS Office provides a powerful, lightweight, and free alternative for your daily document and PDF needs. You can easily insert, extract, delete, and organize PDF pages manually within a familiar interface, alongside robust word processing, spreadsheet, and presentation tools.

Seamless compatibility with standard PDF files and Microsoft Office formats (.docx, .xlsx, .pptx).Easily add, delete, merge, and organize PDF pages manually through an intuitive, user-friendly interface.Lightweight application that runs smoothly across Windows, Mac, Linux, and mobile devices.Built-in tools for filling standard PDF forms, signing documents, and converting PDFs to Word or Excel.
microsoft office alternative - wps office

Frequently Asked Questions

Why do the Add and Delete buttons fail to work when users open the PDF in Google Chrome?

Built-in PDF viewers in modern web browsers (like Google Chrome, Microsoft Edge, or Safari) lack support for advanced Acrobat JavaScript features, including page template spawning. For the buttons to work, users must download the PDF and open it in a dedicated program like Adobe Acrobat Reader.

Can I hide the original template so users only see it when they click the Add button?

Yes. When you configure the page template in the 'Organize Pages' > 'Page Templates' menu in Acrobat Pro, you can toggle the template's visibility to 'Hidden'. The JavaScript will still be able to successfully spawn copies of this hidden page.

How do I prevent form fields from mirroring data across the newly added pages?

To prevent data duplication, ensure your JavaScript spawn command includes the parameter 'bRename: true' (e.g., expTplt.spawn({nPage: pageNum, bRename: true})). This forces Acrobat to generate unique field names for every spawned copy of the template.