Smooth
Smooth

Reputation: 11

displaying footer on last page

i have a dynamic pdf that can have multiple pages. at the moment i want footer to only display in last page instead of all the pages.

this code displays in all the pages.

<fo:layout-master-set>
  <fo:simple-page-master conditional-page-master-reference="first" page-height="29.7cm" page-width="21cm">
    <fo:region-body margin-bottom="10mm" margin-left="10mm" margin-right="10mm" margin-top="10mm"/>
    <fo:region-after extent="10mm" margin-left="1cm"/>
  </fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence conditional-page-master-reference="first">
  <fo:static-content flow-name="xsl-region-after">
    <fo:block>I need my footer disclaimer here</fo:block>
  </fo:static-content>

Upvotes: 0

Views: 312

Answers (1)

Tony Graham
Tony Graham

Reputation: 8068

Instead of the fo:page-sequence referring to a single fo:simple-page-master, you want it to point to an fo:page-sequence-master (see https://www.w3.org/TR/xsl11/#fo_page-sequence-master) that has sub-elements for selecting specific fo:simple-page-master based on where the page will be in its page sequence.

In your case, you want to select a fo:simple-page-master for the last page that has an fo:region-after with a distinct region-name. Your fo:static-content in the fo:page-sequence should use the same region name so that the disclaimer is directed only to that fo:region-after.

Examples of `page-position="last"' (see https://www.w3.org/TR/xsl11/#page-position) include:

Upvotes: 1

Related Questions