PDF Editing Issues

How to Create a New Empty PDF Form Page from a Template

Elise WilliamsElise Williams Nov 3, 2026 868 views

Question details

The user needs to generate a new, blank form page from an existing PDF template without carrying over the data already entered on the original page.

Product
PDF
Device & OS
not provided
Scenario
Creating multiple independent form pages dynamically from a single template using scripting.
Observed behavior
When spawning a new page, the fields default to sharing the same names as the original, causing entered data to duplicate. The goal is to make the newly spawned page empty with independent fields.
Before you start

Ensure you have access to the JavaScript console or document-level scripting in your advanced PDF editor, and that your source page is correctly configured as a hidden template.

Solution 1Recommended

Use the spawn Function with bRename Set to True

Modify the JavaScript spawn function parameters to rename the fields on the new page, ensuring they do not share values with the original template.

When using the spawn method in PDF JavaScript, form fields on the newly created page inherit the original names by default. Because PDF specifications link data across fields with identical names, data entered on the first page will automatically duplicate onto the new page. Setting the bRename parameter to true prevents this by making each field name unique on the spawned page.

1
Open JavaScript editor

Launch the JavaScript console or the button action script editor within your advanced PDF application.

2
Locate the spawn script

Find the script section where the getTemplate and spawn methods are called to generate the new page.

3
Add the bRename parameter

Modify the spawn method parameters to include bRename: true. For example: var t = this.getTemplate('TemplateName'); t.spawn({nPage: this.numPages, bRename: true, bOverlay: false});

4
Execute the script

Run the script or click the associated trigger button to generate a fresh, empty page with uniquely named fields that will not duplicate your previous inputs.

Use the spawn Function with bRename Set to True
Adobe API Documentation: Refer to the Acrobat JavaScript API Reference for the Template object to review all available parameters for the spawn method.
Manage PDF Forms Seamlessly

Edit and Fill PDF Forms Easily with WPS Office

If you prefer managing PDF pages and filling interactive forms without writing complex JavaScript, WPS Office provides an intuitive and lightweight PDF editor for all your document needs.

  1. 1. Open your PDF: Launch WPS Office and open the PDF form or document you wish to edit.
  2. 2. Manage pages: Navigate to the 'Page' tab to easily insert blank pages or extract existing ones without using code.
  3. 3. Fill and edit forms: Switch to the 'Form' tab or directly click on interactive text fields to enter your data or clear existing entries.
  4. 4. Save your changes: Click 'Save' or 'Export to PDF' to preserve your independent page edits.
Easily insert, duplicate, or delete PDF pages with a few intuitive clicks.Seamlessly fill out and manage interactive PDF forms without complex scripts.Fully compatible with standard PDF formats and Adobe Acrobat forms.
microsoft office alternative - wps office

Frequently Asked Questions

Why does data duplicate when I add a new form page?

In PDF documents, fields that share the exact same name will automatically share the same value. If you duplicate a page without renaming the fields, any text typed in one field updates all other fields with that name.

How do I clear fields on just one page instead of the whole document?

To clear fields on a specific page, the fields must have unique names. If they do, you can use a JavaScript loop to target just those unique field names and set their values to null, leaving the rest of the document intact.

Does the spawn function work in all PDF readers?

No, advanced JavaScript capabilities like the spawn method are typically supported only by robust desktop PDF editors. Basic web browser viewers or lightweight readers may ignore these scripts.