Copy link to clipboard
Copied
Hello, and need help...
I have a footer showing the page numbers (#/#) in an application I am creating. Easy peesy, but then I involve spawned hidden pages that can be respawned for more. But those pages with the footers don't update. The total number retains the original page count, and the sequence of pages do not adjust.
Is there some way, perhaps a Javascript action, where I can get the pages on the footer to update?
Place this as a calculation script in the page number fields:
event.target.value = this.pageNum+1;
or
event.target.value = this.pageNum+1 + " / " + this.numPages;
==> You must add "calculateNow()" at the end of the spawning script to update these fields.
The "edit footer" feature adds static content to the PDF pages. The footer text cannot be updated dynamically with a script. The only way to add dynamic page numbers to spawned Page Template is with a text field on the templates.
Just add a calculation script to it using the code provided by JR.
Copy link to clipboard
Copied
Place this as a calculation script in the page number fields:
event.target.value = this.pageNum+1;
or
event.target.value = this.pageNum+1 + " / " + this.numPages;
==> You must add "calculateNow()" at the end of the spawning script to update these fields.
Copy link to clipboard
Copied
Thanks, though I can't quite figure how to put script in the page number fields. I tried.. I am using Adobe Acrobat Pro, latest version. Help?
Copy link to clipboard
Copied
Read this, and watch the free videos:
https://www.pdfscripting.com/public/PDF-Form-Scripting.cfm
Copy link to clipboard
Copied
I know a lot of that stuff already and don't have time to watch a ton of everything to get to the simple solution I need.
My assignment on this is due very soon and the page numbers were merely an extra touch.
And, your link requires me to create a member account and PAID subscription for anything that is linked (and videos), especially the section where I think the answer lies. Sorry, I am not doing that.
Copy link to clipboard
Copied
All the basic info on the site is free
You'll find the answer you need, i.e., how to enter the field calculation script here:
https://www.pdfscripting.com/public/Editing-Fields-Properties.cfm
and here:
https://www.pdfscripting.com/public/Entering-Calculation-Scripts.cfm
Copy link to clipboard
Copied
That's a lot better, but there is a misunderstanding from the original answer. i thought JR meant to put this into the edit footer feature where I put the page numbers, where there is no opportunity to place any fields. Your solution seems to infer that to place a field on each page and then do a calculation script, which is a good idea. But unfortunately, I am running out of time and can't focus on learning through a ton of things I know, and don't need to know (right now), for this to get to the solution, so I give up. Thanks anyway..
Copy link to clipboard
Copied
The "edit footer" feature adds static content to the PDF pages. The footer text cannot be updated dynamically with a script. The only way to add dynamic page numbers to spawned Page Template is with a text field on the templates.
Just add a calculation script to it using the code provided by JR.
Copy link to clipboard
Copied
Thanks,
Unfortuntatly, I figured that too late, as I thought JR meant the page number "fields" in the footer text editing page where I applied the page numbers, which I thought you could somehow. I just needed the means to put that script and that's it. Didn't think of of putting a text field on the templates itself....which would have been a better workaround.
Copy link to clipboard
Copied
@JR Boulay Works perfectly, after realizing I just needed to put a field on every page with the script. Thanks also @Thom Parker for clarifying!