PDF Editing Issues

How to Let Users Duplicate a Page in an Interactive PDF Form

Amos GikundaAmos Gikunda Oct 28, 2026 869 views

Question details

The user wants to provide a button in an interactive PDF form that allows end-users to duplicate a specific page (like a repeatable form section) without modifying the main document structure.

How to Let Users Duplicate a Page in an Interactive PDF Form
Product
PDF Editor
Device & OS
not provided
Scenario
Creating advanced interactive PDF forms with repeatable sections.
Observed behavior
Needs a method to spawn new template pages dynamically using a form button and JavaScript.
Before you start

Ensure you have a professional PDF editor with form creation and JavaScript execution capabilities, and verify that your document is not restricted by security passwords.

Solution 1Recommended

Use Template Objects and JavaScript to Duplicate Pages

This method allows users to click a button to spawn a new copy of a hidden template page within the PDF form.

To accomplish this, you must define the target page as a 'Template' and then assign a custom JavaScript action to a form button.

1
Open PDF Editor

Open your PDF form in your advanced PDF editor and navigate to the page organization tools.

2
Create a Page Template

Select the page you want to duplicate, find the 'Page Templates' option, name the template (e.g., 'RepeatPage'), and set it to be hidden.

3
Add a Button Field

Switch to the form editing mode and insert a 'Button' field into your document where users can easily click it.

4
Configure Button Actions

Right-click the newly added button, select 'Properties', and go to the 'Actions' tab.

5
Add JavaScript Action

Set the 'Select Action' dropdown to 'Run a JavaScript' (or equivalent) and click 'Add'.

6
Write the Spawn Script

Enter the script to spawn the page, such as: var expTplt = getTemplate('RepeatPage'); expTplt.spawn({nPage: pageNum, bRename: true, bOverlay: false}); and save your changes.

Use Template Objects and JavaScript to Duplicate Pages
Field Naming: Ensure the 'bRename' parameter is set to true in your script so that copied form fields get unique names and do not duplicate data across pages.
Free Microsoft Office alternative

Edit PDFs and Forms Easily with WPS Office

While advanced JavaScript page spawning requires complex configuration in heavy software, WPS Office provides a lightweight, highly compatible alternative for everyday PDF editing, form filling, and document management.

Easily fill, edit, and sign interactive PDF forms without complex scripts.Seamlessly convert between PDF, Word, Excel, and PowerPoint formats.Fully compatible with standard PDF features and Microsoft Office file formats.Lightweight software that opens large documents quickly and won't slow down your computer.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the duplicated page share the same data as the original?

If the form fields on the duplicated page have the exact same names as the original, the data will mirror across both pages. You must ensure your JavaScript renames the fields upon spawning by setting the bRename parameter to true.

Can users duplicate pages in a free PDF reader?

Yes, free PDF readers can usually execute the JavaScript attached to the button to spawn the page, provided the PDF form was created properly and saved with extended reader rights.

How do I allow users to delete a spawned page?

You would need to add another button with a JavaScript action designed to delete the spawned page using the deletePages() method, targeting the specific page number of the duplicated section.