Skip to main content
robs15305
Participant
October 25, 2017
Answered

Automatic page number updates in merged pdf docs

  • October 25, 2017
  • 1 reply
  • 2811 views

Is there a way to create page number fields that automatically update when you insert or merge pages from one pdf file to another pdf file?  For example, if one pdf file has 4 pages, the page numbering is 1 of 4, 2 of 4, 3 of 4, 4 of 4.  If I insert a page from a different pdf document, I want the page numbering to automatically change to Page 1 of 5, 2 of 5, 3 of 5, 4 of 5, and 5 of 5.

This topic has been closed for replies.
Correct answer try67

Thanks Bernd.  All the field names with this script are different.


Replace this.pageNum with (event.target.page+1) and add a doc-level script with this code:

this.calculateNow();

1 reply

Inspiring
October 25, 2017

You will have to add a unique form field to each page of each document and then add a custom calculation script to each form field.

event.value = "Page " + this.pageNum + " of  " + this.numPages + " Pages"

robs15305
robs15305Author
Participant
October 25, 2017

Thanks.  I changed this to event.value = this.pageNum + " of " + this.numPages because I don't need "Page" or "Pages". 

It's showing 1 of 2 on both pages instead of 1 of 2 on page 1 and 2 of 2 on page 2?

Bernd Alheit
Community Expert
Community Expert
October 25, 2017

Don't use the same name for both fields.