how to show/hide pages in an adobe acrobat form
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?
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?
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.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.