11 Replies Latest reply: Feb 12, 2014 12:33 PM by BSisson RSS

    How do I move a Page into a template?

    BSisson Community Member

      I have a MONDO form, with lots (and lots) of pages.

       

      I want to move a page (or more) onto (into ?) a template so I can hide/unhide it as needed using Javascript.

       

      I can't find anything in Acrobat Pro-XI that talks about templates, or how to define a page/section/etc as part of a template.

       

      I understand that I will need the latest and greatest reader version to use this function/feature.

       

      Is there any other way to make an entire page appear/dissaper?

       

      I don't want to use "external" documents, as then all of the things that total pages will return error if the pages aren't there.

       

      If they are "there" but hidden, everything works fine.  If I need the pages, I can "unhide" them and everything else stays the same...

        • 1. Re: How do I move a Page into a template?
          George_Johnson CommunityMVP

          To make a page a template in Acrobat 11, open the document to that page and select: Tools > Document Processing > Page Templates

           

          and type in a name (anything) and press the Add button. You can then click the little eye icon to the left of the name to show/hide it.

          • 2. Re: How do I move a Page into a template?
            George_Johnson CommunityMVP

            By the way, you don't need the lastest version of Acrobat to create or use the form, but Reader users will need Reader 11 to use it and create new pages from templates.

            • 3. Re: How do I move a Page into a template?
              BSisson Community Member

              Wow, that was easy...I just have to move the template so it is inline where it belongs...I think.

               

              What I -think- I want to do is..

               

              page5

              page6

              page 6a (Hidden template)

              page 6b (Hidden template)

              page 7

              page (etc)

               

              All of the field names on 6,6a,6b would be different so that calls and things that "total" things would be happy.

               

              If I need more 'space' than is available on page 6, I want to invoke a script that "unhides" existing page 6a and everything else stays the same...

                        (The 'totals' for 6,6a & 6b would be on page #7 in this example)

               

              Primary Question: Will this work?

              Question #1...There was considerable discussion on the forums about "privileges" and if you can do this in certain modes. 
                                     Can a CheckBox invoke a JavaScript to do the "Un-Hiding"?

              Question #2... Since I am not 'creating' a form page, only "unhidding" it, does the restriction on needing Reader_11 still hold?

              Question #3... Is there a 'better' way to do this?

               

              Note: These pages are FULL of stuff... so just masking a field, or hiding it behind something won't be very user friendly.  If I can make this work, it will be very usable and easy to follow.

              • 4. Re: How do I move a Page into a template?
                George_Johnson CommunityMVP

                If it needs to work with Reader, you can't unhide, you create a new page by spawning from a hidden template page. This will work with Reader 11 if the form is not Reader-enabled with Acrobat, but it won't work on mobile devices. The code to spawn a new page will work in a check box.

                • 5. Re: How do I move a Page into a template?
                  BSisson Community Member

                  Hum...

                  Not sure how that would work in I have lots of numbered fields that I need to work with.

                   

                  If I have Fields 1-5 on page 1

                                            6-11 on page 2 (hidden)

                                          12-17 on page 3 (hidden)

                   

                  I can then add up -all- the fields, hidden or not, and the code remains the same.

                  Not sure how that would work if I need to "Spawn"  a page from a template....

                  The code to detect if one of the hidden pages has been spawed would be really complex...

                   

                  I have seen several discussions with people having the same issue, and never seen a good, clean solution.

                   

                  My issue is that I have 63+ fields on each of those pages...so trying to dynamically edit the "totals" page would be, uhm... a royal pain the the whats-sit.

                   

                  IDEAS PLEASE !

                  • 6. Re: How do I move a Page into a template?
                    George_Johnson CommunityMVP

                    When you spawn a page, the fields do not need to be renamed (though this is often done), so there shouldn't be a problem.

                    • 7. Re: How do I move a Page into a template?
                      BSisson Community Member

                      Then I don't quite understand how template pages function.

                       

                      Does that mean that fields on a template page are not visible to the rest of the form while they are "hidden"?

                       

                      My fields are consecutively numbered so I can add them up with a simple loop....

                       

                      something like : for (var lineNo=0; lineNo <= 17; lineNo++) { total = total +this.getField(Fieldname+lineNo).value }

                       

                      If I have Fields 1-5 on page 1

                                                6-11 on page 2 (hidden template)

                                              12-17 on page 3 (hidden template)

                       

                      If I try to add up fields 1-17, but 6-17 are "hidden" on a template page, will JS give me an error?

                       

                      next...when I "spawn" the page do I end up with

                       

                            I have Fields 1-5 on page 1

                                                6-11 on page 2 (spawed and visible)

                                                6-11 on page 2 (hidden template)

                                              12-17 on page 3 (hidden template)

                       

                      do I now have TWO sets of fields 6-11??   (Will acrobat do the Field 6#1 and Field 6#2? thing?)

                       

                      What will happen when I try to run my script to add up fields 1-17?

                       

                      I am sure I can detect if the extra pages are there, and change the loop size, but that means building some 'special cases', which are error prone. And then you have to "Undo" and delete the pages if they un-select the page...it gets really messy realy fast... and my forms are messy enough as it is....

                       

                      PS...I have over 750 fields, running the "total" fuction takes about 2 seconds from "mouse_up" on the caculate button, 4 seconds on a tablet.

                      • 8. Re: How do I move a Page into a template?
                        George_Johnson CommunityMVP

                        Yes, there will be two sets after the template is spawned. Whether the fields are not shown because they're on a hidden template or are shown because the hidden template has been spawned, the calculation scripts will get triggered whenever any field value changes. It will simply work and you should not get any JavaScript errors.

                        • 9. Re: How do I move a Page into a template?
                          BSisson Community Member

                          I will have to build a test page or so...

                           

                          My calculation is only done on a "mouse_up" on a button on the last page, otherwise it would be unusable, 4 seconds everytime somethig changed...na...

                          • 10. Re: How do I move a Page into a template?
                            George_Johnson CommunityMVP

                            That makes it easier. It should just work.

                            • 11. Re: How do I move a Page into a template?
                              BSisson Community Member

                              Love to send you a copy of my working form... you inspired a lot of the scripts...

                               

                              Send me a PM if you want a copy to look at.......