Skip to main content
Participant
May 2, 2018 9:42 AM UTC
Answered

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

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 is closed to new replies. Start a new post to keep the conversation going.
gkaiserilCorrect answer
Inspiring
May 2, 2018 5:46 PM UTC

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.

5 replies

gkaiserilCorrect answer
Inspiring
May 2, 2018 5:46 PM UTC

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.

Translate
Participant
Nov 24, 2023 8:57 AM UTC

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

Translate
Bernd Alheit
Community Expert
Community Expert
Nov 24, 2023 9:25 AM UTC

You can spawn the page more then once.

Translate
Thom Parker
Community Expert
Community Expert
May 2, 2018 2:48 PM UTC

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

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