Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Spawned pages and page numbering using JS

Explorer ,
Sep 28, 2016 Sep 28, 2016

With the help of prevously asked questions/answers, various tutorials and lots of luck, I've managed to create a button that spawns a new page. I've also managed to add page numbers in the format 1 of n to a specific field on the pages.

The problem I'm having is if I delete one of the spawned pages, how do I get the JS to recalculate the page numbers so it goes from, for example 1 of 3, 2 of 3, 3 of 3 to 1 of 2, 2 of 2 (the document will always start with 2 pages)

In the custom calculation of my page number field, this is the code I used:

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

Any help gratefully received.

I'm using Acrobat Pro DC

Thank you

TOPICS
Acrobat SDK and JavaScript , Windows
247
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
no replies

Have something to add?

Join the conversation