Skip to main content
Participant
April 8, 2019
Answered

Question about page numbers for a hidden template.

  • April 8, 2019
  • 1 reply
  • 1334 views

I have a two page form, created in Acrobat DC, that contains a table on the second page for entering information about purchase order line items.  If the user needs additional lines I have included a java code button on page 2 to open a hidden template page.  The user can continue to add more pages as needed.  Is there a way to have these added pages sequentially numbered (beginning with page 3) at the bottom center of the pages?

This topic has been closed for replies.
Correct answer Thom Parker

Yes,  Add a readonly form field to the bottom of the template page for the page number.  You can either add a calculation script to the field for setting the number:

event.value = event.target.page + 1;

or add code to your script for spawning the page. This is actually preferable because calculations can become problematic if there are lot of them on the PDF.

1 reply

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
April 9, 2019

Yes,  Add a readonly form field to the bottom of the template page for the page number.  You can either add a calculation script to the field for setting the number:

event.value = event.target.page + 1;

or add code to your script for spawning the page. This is actually preferable because calculations can become problematic if there are lot of them on the PDF.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
kmorrell2Author
Participant
April 10, 2019

Thom, thank you.  I'll give that a try.