Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

how to show/hide pages in an adobe acrobat form

Community Beginner ,
Apr 29, 2018 Apr 29, 2018

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?

TOPICS
PDF forms
24.0K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
LEGEND ,
Apr 29, 2018 Apr 29, 2018

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.

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 29, 2018 Apr 29, 2018

If all users are using Acrobat, then one can use the template feature to show or hide pages set with the template property.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 29, 2018 Apr 29, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 30, 2018 Apr 30, 2018

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]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 30, 2018 Apr 30, 2018

For Acrobat Reader DC you don't need the reader extension.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 30, 2018 Apr 30, 2018

Thank you. ☺

[Moderator Note: personal information removed from this public forum.]

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 30, 2018 Apr 30, 2018

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
May 02, 2018 May 02, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
May 02, 2018 May 02, 2018

Did you replace the hidden template?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 04, 2021 Jan 04, 2021

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?

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jan 11, 2021 Jan 11, 2021

Hello,

Did you find a solution to this question?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 16, 2025 Apr 16, 2025
LATEST

hi, did you get the solution ? 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines