Question

I have the following (part of) xsl:fo template

<fo:root font-size="11pt" font-family="Arial">
  <fo:layout-master-set>
    <fo:simple-page-master master-name="A4-portrait"
              page-height="29.7cm" page-width="21.0cm" margin-top="1cm"
              margin-left="1.5cm" margin-right="1cm" margin-bottom="1cm">
      <fo:region-body />
      <fo:region-after region-name="footer" extent="15mm"/>
    </fo:simple-page-master>
    <fo:simple-page-master master-name="A4-landscape"
              page-width="29.7cm" page-height="21.0cm" margin-top="1cm"
              margin-left="1cm" margin-right="1cm" margin-bottom="1cm">
      <fo:region-body />
      <fo:region-after region-name="footer2" display-align="bottom" extent="0cm"/>
    </fo:simple-page-master>
  </fo:layout-master-set>
  <fo:page-sequence master-reference="A4-portrait">
    ...........
  </fo:page-sequence>
  <fo:page-sequence master-reference="A4-landscape" font-size="8pt" id="end">
    <fo:static-content flow-name="footer2" font-size="7pt" font-family="Arial">
      <fo:block text-align="center">
                Page <fo:page-number/>/<fo:page-number-citation ref-id="end"/>
      </fo:block>
    </fo:static-content>
    <fo:flow flow-name="xsl-region-body">
     ........................
    </fo:flow>
  </fo:page-sequence>
</fo:root>

The first page-sequence generates exactly one page. The second page-sequence generates multiple pages (for example 9), which I want to "decorate" with footers where I can display the page numbers. The problem is - for the last page, <fo:page-number> generates 10, 1 from the first page-sequence + 9 from the second page-sequence; and <fo:page-number-citation ref-id="end"/> generates 9. So, page 10 of 9 sounds like an overflow and it's embarrassing. Can anyone please help?

Was it helpful?

Solution

I hope this helps someone someday, I found the solution. I should've used <fo:page-number-citation-last ref-id="end"/>

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top