I have a form that spans around 10 pages and 6 of them are hidden so based on selection some of the pages will show. I have a page counter that is always displaying all the 10 pages. Like Page 1 of 10 even though there are only 4 pages displayed. How can I get the correct count based on what's shown to the user.
do a test:
Create a new form
Add 2 pages to it
On the master page insert the page n of m from the custom library
From the Object tab hide one of the 3 pages then preview in PDF
Glad it worked out for you!
Here is what I was doing wrong.
I was only hiding the pages through presence = "hidden" and the object was still visible so it was still counting the pages. I did what you told me and it worked. Thanks for your direction.
I put it on the form initialization.
where did you put .presence="hidden". you do not need to do that.
I put the page numbering on the Master Page (page # of ##) and using the .presence = "hidden" on Initialization of the form.
How are you setting up your numbering. I just ran a test where I created 3 pages and hid the 2nd page. I get 1 of 2 and 2 of 2. When I unhide the page I get 1 of 3 etc.
Did you put the page numbering on the master page? Are you hiding the page or making it invisible?
I am using "Page n of m" control and it still displays the total numbers of pages which are 1 of 10 and 2 of 10 and 3 of 10 even though I am only showing the 3 pages. (I only want it to show the number of pages showing like 1 of 3 and 2 of 3 and 3 0f 3 and not take the other ones into the count.).
I forgot to mention that we are using AEM and the pages are displaying as HTML5 and I am seeing some odd behavior that was working in regular forms and now they are acting differently like for example xfa.host.messageBox (Acts differently on a HTML form than regular xdp.
Are you using the standard "Page n of m" control, this should allow for hidden pages as it uses xfa.layout.page(this) to get the page of the current object in the layout dom and xfa.layout.pageCount() which gets the total pages.