18 Replies Latest reply on Jun 30, 2016 5:38 PM by damianl49224290

    Dynamic Page Numbering script isn't working on spawned pages?

    jfb45671162

      I'm working in Acrobat Pro XI on a 4 page document with a button that allows a template pages to be inserted after page 3.  I created a button for this and it is working fine.  But each page has a text field that is supposed to auto update all of the page numbers.  The code looks like this:

       

      event.value="Page "+(event.target.page+1)+" of "+this.numPages;

      calculateNow();

       

      On the four pages visible when the file is opened it is working perfectly; they will update from "Page 1 of 4" to "1 of 5", etc. without any problems.  However, the inserted template pages are very random.  Sometimes the first spawned one will work and say Page 4 of 5 but sometimes it will say Page 0 of 4.  It's worth mentioning that even when it says Page 4 of 5 printing that page shows it saying Page 0 of 4 again.  And any additional pages spawned after that will list a bunch of random numbers out of the correct number of pages.  So it will look like "Page 7, 6, 5, 4, 31 of 9".

       

      I've been looking through a lot of previously asked questions and haven't seen any quite like this.