Getting the page number in a form seems pretty straightforward if you use the handy prefab button. I'm working on a general office form, and the assumption is that the actual print copy will have more pages stapled to it (like for a fax).
I'd therefore like the option to add some page number padding to the xfa.host.numPages.
when I app.alert it, it seems that the xfa.host.numPages isnt going into the numPages variable. Is there a trick to accessing the info in the xfa stuff?
well, i realized that once again I'm asking the wrong question... dont need 2 variables, can just add xtraPages to xfa.host.numPages and get the same effect.
The variable needs to be referenced on its own. You do not need the .value afterwards. So it should be:
numPages = xfa.host.numPages
You can validate that the call is working by doing:
If that returns what you expect, then do:
that's making progress finally.
Do you have any further thoughts on where to keep the
numPages = xfa.host.numPages variable updated? I'm not getting it to recalculate with other events (like when the content flows to another page). I've tried it on layout:ready, calculate & form:ready. None of them are updating automatically, but if I tickle a different button on the form it will update to the correct value.
Oh, and the buttons that add fields which cause another page to be added to have the xfa.form.recalculate(1) set currently.