9 Replies Latest reply on Jul 15, 2015 10:38 AM by George_Johnson

    mutli page spawning

    dhhsc84757271 Level 1


      I found this script in one of the older threads and it works great!! (George_Johnson)

      Now, I only need one small modification.  My template that is spawned has a button on it that spawns a signature page.  Initially this was not a problem because there was only one spawned page and then the user would click the "sign" button to spawn a signature page.  Now with the multi page script, if I spawn 10 pages, they all have "sign" buttons.  I need the "sign" button to only appear on the very last page that was spawned.  Is there anyway to do that with the script I am currently using?  I am using Adobe Pro XI.

       

      Current script:

       

      Capture.JPG

        • 1. Re: mutli page spawning
          George_Johnson MVP & Adobe Community Professional

          To do that you'd normally make the template hidden and not include the button on it. During the creation of the base form, you'd spawn the template once to create the initial page and add the button to it.

          • 2. Re: mutli page spawning
            dhhsc84757271 Level 1

            I'm not quite sure I follow what you're saying.  The spawn template (contains the "sign" button) is currently hidden.  My base form has 3 pages, at the bottom of the 3rd page, there are 2 buttons ("Add Page" and "Sign").

            • At the bottom of the 3rd page, If the user selects "Sign", a signature page is spawned and the "Add Page" and "Sign" buttons become hidden.  End of process.
            • If the user selects "Add Page", a template is spawned for one additional page.  this additional page also contains a "Sign" button and I have a script set up so that the "Add Page" button and "Sign" button on the 3rd page become hidden, leaving only the "Sign" button at the bottom of the spawned 4th page...the user then uses that button to spawn the signature page and the buttons are set to become hidden as previously mentioned.

             

            I'm needing the same thing to happen, so if the user adds pages...however many, they will only see the "Sign" button on the very last page.  I could do it before because I only needed one additional page, so managing the buttons was easy, but without a predetermined page limit, it's more difficult.

            • 3. Re: mutli page spawning
              George_Johnson MVP & Adobe Community Professional

              I see. In that case, you can add another hidden template page that includes just the sign button you want to be on the last page. After adding the additional pages by spawning the first template multiple times, spawn the button template on top of the last page and set beRename to false and bOverlay to true. You just have to figure out the correct page number to use with the nPage parameter.

              • 4. Re: mutli page spawning
                dhhsc84757271 Level 1

                OK.  So where in the script would I be inserting the second instance of the new hidden template for spawning?

                • 5. Re: mutli page spawning
                  George_Johnson MVP & Adobe Community Professional

                  Just before the else block at the end.

                  • 6. Re: mutli page spawning
                    dhhsc84757271 Level 1

                    Thanks!  I'll try it out and report back.  Thanks again.

                    • 7. Re: mutli page spawning
                      try67 MVP & Adobe Community Professional

                      I think that creating another template just for the purpose of removing the Sign and Add Page buttons is a bit of an overkill.

                      You could easily write a script that will iterate over all the fields in the file, looking for the fields that match a specific name pattern and then hide them if they're not located on the last page of the file.

                      • 8. Re: mutli page spawning
                        dhhsc84757271 Level 1

                        Do you have an example of what a script like that would look like?

                        • 9. Re: mutli page spawning
                          George_Johnson MVP & Adobe Community Professional

                          Gilad D (try67) wrote:

                           

                          I think that creating another template just for the purpose of removing the Sign and Add Page buttons is a bit of an overkill.

                           

                          Or straightforward and simple.