Reputation: 1
I have five "pages" in a PDF I have created. Each page has an associated Master Page that dictates that "page"'s layout, header, footer, etc. I also included a second page in the layout for each that properly re-adjusts the header/footer. When I say "page" what I am referring to is unique subforms (insert page from the hierarchy) that are individual forms.
An Intro page contains fields that are used on all the subsequent pages as well as a list the user selects to enable (un-hide) the pages coded into the PDF. Everything works great except for page numbering. I need the page numbering to start as Page 1 of x for each new page that the user un-hides based on their selection.
Page Hierarchy and associated master pages:
Intro Intro PBL PBLMaster (PBLM1, PBLM2) Improve ImproveMaster (ImprvM1, ImprvM2) Implement ImplementMaster (ImpM1, ImpM2) Control ControlMaster (ConM1, ConM2)
Each page has the following set under OBJECT - PAGINATION:
PBL -
Place: On Page PBLMM1 Keep With: (neither are selected) After: Continue filling parent If dataset must be paginated: Overflow: Go To Page PBLM2
And the same for each other page as appropriate.
In the Master Pages I have each Object - Pagination set as:
Include page in numbering selected For the first master page (M1) I state Start at 1 For the next page (M2) I state to continue numbering from Previous Document in batch
However, as I unhide pages they all are paginated, starting at Page 1 with no re-setting to a new Page 1 when the new Master Page is invoked. How do I fix this?
Upvotes: 0
Views: 6350
Reputation: 31
I have two forms in a single PDF. Both are flowing on to unlimited number of pages. I have the page numbering displaying as 1 to x for the first form and 1 to y for the second form (both are in the same physical pdf). I think this is what you are trying to do.
Here is my solution:
I have two Master Pages, eg Page1 and Page2. Each with a currentPage and pageCount field.
On the Design View, I have two body subforms at the root called ministry_document and proponent_document. The proponent_document pagination starts on the Page2 master page.
The javascript in the Master Pages paging fields is this:
Page1.currentPage layout event:
this.rawValue = xfa.layout.page(Page1);
Page1.pageCount layout event:
this.rawValue = xfa.layout.pageSpan(ministry_document);
Page2.currentPage layout event:
this.rawValue = xfa.layout.page(Page2) - xfa.layout.pageSpan(ministry_document);
Page2.pageCount layout event:
this.rawValue = xfa.layout.pageSpan(proponent_document);
Upvotes: 3