Search code examples
xsl-fo

XSL-FO: Multiple Pagenumber Sequences


Have a document that has two sections, so need two pagenumber sequences, one for the document and one for each of the sections.

So each page will have the 2 page numbers printed

Section 1: Section Page #, Document Page #
Section 2: Section Page #, Document Page #

How do I achieve this?


Solution

  • If what you want is something like this:

    • section 1 page 1, document page 1
    • section 1 page 2, document page 2
    • section 2 page 1, document page 3
    • ...

    it cannot be achieved using only standard FO elements and properties.

    Each fo:page-sequence can either define a new initial-page-number or continue the previous page number sequence; in both cases, each page has just a single page number:

    The value of the folio-number trait on the first page returned by the fo:page-sequence is constrained to equal the value of the initial-page-number trait. The value of the folio-number trait on subsequent pages is constrained to be one greater than the value on the immediately preceding page.

    The format, letter-value, grouping-separator, grouping-size, country, and language traits are used to format the number into a string form, as specified in XSLT. This formatted number is used by the fo:page-number flow object.

    XSL-FO 1.1 recommendation, 6.4.13 fo:simple-page-master