Skip to main content
jwbriney
Participant
January 30, 2020
Question

Page Numbers in Footer not updating

  • January 30, 2020
  • 1 reply
  • 3298 views

I have added page numbers into the footer of my PDF, but if I move a page around or delete one in the organize PDF section, the footer doesn't update.

 

Is there a way to force this update to happen?

This topic has been closed for replies.

1 reply

Thom Parker
Community Expert
Community Expert
January 30, 2020

The headers and footers are static text, so they do not update on thier own. To do this. First remove the header/footer, move the pages, then reapply the header/footer.

 

Alternatively, you could add a field to each page that displays the page number, then when a page if moved or deleted the page numbers would automatically update.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
jwbriney
jwbrineyAuthor
Participant
January 31, 2020

Hey Thom, thanks for the reply! I started looking at this and added some fields to each page, but am running into some issues. Here's what I've done:

 

  1. Added a text field to each page with a unique name and put "event.target.page+1" in the Custom Calculation Script under "Calculate".
  2. Added a Document Javascript with "this.calculateNow();"

 

When I move a page around the page number field isn't updating. I'm not well versed in this so apologies in advance, but if you could give a quick step by step on how to get this working I'd appreciate it!

 

Thanks,

John

Thom Parker
Community Expert
Community Expert
January 31, 2020

Calculation scripts run when any form field value changes. Moving pages doesn't change the field value. 

 

However, changing page numbers is only related to your moving things about. I imagine you want them to remain stable for the document users?

 

To this end simply run "this.calculateNow()" in the console window, and remove it from the document script. 

Alternatively, changing any field value will cause the upate, for example a check box on the first page. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often