Skip to main content
Participant
May 2, 2018
Answered

How do I create a button that inserts the same empty form on the next page, in my form?

  • May 2, 2018
  • 2 replies
  • 2280 views

Hello,

I am searching for the anser on the question "How do I create a button that inserts the same empty form on the next page, in my form?".

It's an inspection form with questions about an object.

When you see something that's not correct, then you need to fill that in.

If there are more then 1 incorrect parts, then the inspector needs to be able to click on a button which inserts a new page.

This new page has to be the exact same form.

How do I create the right button with the right script that adds the new page?

This topic has been closed for replies.
Correct answer gkaiseril

As noted you need to use templates. This feature has been available for a very long time.

A Lesson in Templates by Dave Wraight

I use the following steps to create a hidden template.

1. Create the form with fields. Include a button that will "spawn" a new page with the bRename parameter set to true.

2. Go to the Preview mode or ext the Prepare form tool and use the button to spawn a new page.

3. Use the Prepare From tool to rename all the fields on the spawned page from "P#.." to "P0.".

4. Make the template page Hidden.

This should allow the creation of new form pages with unique field names. If you are using any actions, you may need to adjust them if your are accessing any named fields for the unique field naming on the spawned pages.

2 replies

gkaiserilCorrect answer
Inspiring
May 2, 2018

As noted you need to use templates. This feature has been available for a very long time.

A Lesson in Templates by Dave Wraight

I use the following steps to create a hidden template.

1. Create the form with fields. Include a button that will "spawn" a new page with the bRename parameter set to true.

2. Go to the Preview mode or ext the Prepare form tool and use the button to spawn a new page.

3. Use the Prepare From tool to rename all the fields on the spawned page from "P#.." to "P0.".

4. Make the template page Hidden.

This should allow the creation of new form pages with unique field names. If you are using any actions, you may need to adjust them if your are accessing any named fields for the unique field naming on the spawned pages.

Participant
November 24, 2023

I am assuming that this method is only to copy the page once ?  i wont be able to copy my new template ? as we have to do the same process for the 3rd copy ? how do we make it user friendly so that wheneever you need a extra template then you click the button and it will copy by changing form field names as well ? this would make things so much easier

Bernd Alheit
Community Expert
Community Expert
November 24, 2023

You can spawn the page more then once.

Thom Parker
Community Expert
Community Expert
May 2, 2018

You'll need to use a Page Template, and some JavaScript to spawn new pages.

If you have Acrobat DC Pro, then type "Page Template" into the tool search box. That's the easy part.

Here's the JS reference entry for the template spawn function. A couple of examples are provided.

Acrobat DC SDK Documentation

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often