Copy link to clipboard
Copied
I have created a form in which I want the users to be able to add more context if need be on a second page. How do I set up the form to show a second page if needed?
Copy link to clipboard
Copied
You'll need to use JavaScript.
Begin by adding the page that you want to be shown when needed. In Acrobat, you can make a page a template, which is really nothing more than giving it a name. You should then set the template to hidden. Exactly how you do these steps depends on which version of Acrobat you're using.
You then have to provide some means for the user to generate a new page that's based on the template. A possible way is to add a button to a page and include a script like the following as the Mouse Up JavaScript:
// Get a reference to the template
var t1 = getTemplate("Template1");
// Create a new page, but only if there's currently only one page in this document;
if (numPages == 1) {
t1.spawn({nPage: numPages, bRename: true, bOverlay: false});
} else {
// Do nothing, since the page has already been added
}
This is about the minimum script, so post again if you need it to do anything else.
Note that mobile and some non-Adobe PDF viewers (including browsers) do not have support for spawning templates, so your users should have at least Adobe Reader for WIndows/Mac.
Copy link to clipboard
Copied
If all users are using Acrobat, then one can use the template feature to show or hide pages set with the template property.
Copy link to clipboard
Copied
You'll need to use JavaScript.
Begin by adding the page that you want to be shown when needed. In Acrobat, you can make a page a template, which is really nothing more than giving it a name. You should then set the template to hidden. Exactly how you do these steps depends on which version of Acrobat you're using.
You then have to provide some means for the user to generate a new page that's based on the template. A possible way is to add a button to a page and include a script like the following as the Mouse Up JavaScript:
// Get a reference to the template
var t1 = getTemplate("Template1");
// Create a new page, but only if there's currently only one page in this document;
if (numPages == 1) {
t1.spawn({nPage: numPages, bRename: true, bOverlay: false});
} else {
// Do nothing, since the page has already been added
}
This is about the minimum script, so post again if you need it to do anything else.
Note that mobile and some non-Adobe PDF viewers (including browsers) do not have support for spawning templates, so your users should have at least Adobe Reader for WIndows/Mac.
Copy link to clipboard
Copied
Thanks George. I got this to work. Now, I need to save my master form to a reader extended file form so that users that only have adobe reader can use the form and have the ability to use the second page if needed. When I tested it, I can’t get the “page2” to come up when I click the button. Is this because the spawning of template pages doesn’t work with that version of reader? The version is: Adobe Acrobat Reader DC.
[Personal informations removed by moderator]
Copy link to clipboard
Copied
For Acrobat Reader DC you don't need the reader extension.
Copy link to clipboard
Copied
Thank you. ☺
[Moderator Note: personal information removed from this public forum.]
Copy link to clipboard
Copied
If you do Reader-enable it, the template features won't work, since Acrobat does not add the usage right that allows Reader to spawn templates. But as Bernd said, if your users have Reader 11 or later, they will be able to both use template features and save a filled-in form.
Copy link to clipboard
Copied
Thank you for your help. I do have one last question, I hope. So, I've created the template page and inserted it into my form. After a couple of people reviewed the form I had some modifications which affected the template page. When I updated the template and re-inserted it into my form, the old version of the template keeps showing up when I click the add "pg2" button that I had originally created. Would I have to re-write the java script on that button even though I've named the template page the same as what I did before?
Copy link to clipboard
Copied
Did you replace the hidden template?
Copy link to clipboard
Copied
I have a lengthy form that I only need parts of filled out depending on my clients needs. I have created each section on a different page. I'd like to be able to use conditional formating to turn pages from hidden to visable with a check in a checkbox. Is this possible? If so, How can I accomplish this?
Copy link to clipboard
Copied
Hello,
Did you find a solution to this question?
Copy link to clipboard
Copied
hi, did you get the solution ?
Find more inspiration, events, and resources on the new Adobe Community
Explore Now