Fix an Acrobat Button That Won’t Spawn a Blank PDF Form Page
Question details
The user needs an Acrobat form button to spawn a blank page from a PDF template.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- A button runs JavaScript to add a blank template page to a PDF form.
- Observed behavior
- The template does not hide or appear correctly when the button is clicked.
Open the PDF in Adobe Acrobat with access to Prepare a Form and Page Templates. Confirm that JavaScript is enabled in Acrobat preferences and that the template page has blank form fields.
Check the template and test a simple spawn action
Use this approach to isolate template naming, visibility, and button-script problems before adding more complex logic.
Open All tools > Organize pages > More > Page templates, or the equivalent Page Templates command in your Acrobat version. Check the exact template name, including capitalization and underscores.
In Page Templates, select the template and use its visibility control to hide it. Leave the blank template available for spawning rather than deleting it.
Open All tools > Prepare a form, select the button, and open Properties > Actions. Set the trigger to Mouse Up and select Run a JavaScript.
In the button’s JavaScript editor, use the exact template name in a simple test: var t = this.getTemplate("Template1"); if (t) { t.spawn({nPage: this.numPages, bRename: true, bOverlay: false}); } else { app.alert("Template not found"); } Replace Template1 with your actual template name.
Close the form editor and click the button. If nothing happens, open Acrobat’s JavaScript console and check for errors; once the basic spawn works, add deletion or conditional logic back one piece at a time.

Edit PDF Documents and Office Files with WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with PDFs and Office files. Its format compatibility helps you move existing documents into your workflow, but it does not fix Acrobat-specific template-spawning JavaScript.

Frequently Asked Questions
Why does Acrobat say the template cannot be found?
Open Page Templates and compare its name with the argument in getTemplate(). The name must match exactly, including capitalization and underscores.
Where should I add the spawn script to the button?
In Prepare a form, open the button’s Properties > Actions, choose Mouse Up as the trigger, and add a Run a JavaScript action.
How can I find a JavaScript error after clicking the button?
Open Acrobat’s JavaScript console after testing the button and review any reported errors. Start with a simple spawn script before restoring other logic.
Will the button work in a browser PDF viewer?
Not necessarily. Browser viewers may not support Acrobat’s template-spawning JavaScript, so test the form in Adobe Acrobat.




