Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Adobe Summit 2023 [19th to 23rd March, Las Vegas and Virtual] | Complete AEM Session & Lab list

Excluding specific Master Pages from Total Page Count with Javascripts


Level 3

Is it possible to exclude certain Master Pages from the count for Total Page Count using Javascript?



Page Set 1, only count pages using Master Page 1 & 3 and not Master Page 2 & 4.

Page Set 2, only count pages using Master Page 2 & 4 etc...

These pages are also increasing with Add Instance objects.


I only know this:

this.rawValue = xfa.layout.pageCount()-1

set in a floating field, but the static offset only works for a bit. After a few more page generation, the count goes off.  


Unchecking "Include Page in Numbering" under Pagination works for only one set... I would like for both.



Thank you in advance

0 Replies



Yes if done as shown here:


Each page contains dynamic content and spreads over several sheets. Depending on which Masterpage they are assigned to the numbering is done correctly. I assigned each Seite(x) with a masterpage in sequence over 2 sets.



For those to be excluded I turn off the page numbering


And it works for master pages in BOTH sets. I cannot send the sample PDF here but the Page # of ## shows only the page numbers and total for the master pages included in numbering.


The document has 24 pages but it shows only 12 in the numbering:




Level 3
This is interesting! I'll give it a try. Its going to take a bit to re structure my form, but interesting indeed. Thank you!


Level 3

I was able to recreate your setup and it works. However when I try to apply this to my actual form... no luck. I thought maybe the "Insert Page Set" would do something to set them pages apart from the total count, but not really. Thanks for this idea though! I'll keep this in mind if another form under different condition would be a better fit.


I know that it can be difficult to change an established, complex form design. This kind of requirement needs planning of the structure before one starts - as you can see. The more dynamic an existing form is the more difficult it gets to change it again and get the same or updated results. Good luck!





Each content page is linked to a specific master page and keeps the sequence. Seite1 - Page 1... Seite2-Page2. Don't jump in Master Pages because that often causes empty pages and can cause trouble. I am assuming that the sequence of your pages and master pages are sequential. I cannot upload PDF or XDP here.


The content I faked with a subform and a text field which I gave a binding repeat subform for each data item minimum 70 so that I get 2-3 sheets per Seite simulating the normal grow of content.


Level 3
I should amend this: when I say "page set" I don't mean an actual Master Page "Insert Page Set". Its just wording description.

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now