Reputation: 994
I have some table in my document and I want different margins for odd and even pages, so how can I distinguish a page is odd/even using when condition in xsl fo.
Upvotes: 0
Views: 485
Reputation: 8068
You want:
fo:simple-page-master
for the odd and even pagesfo:layout-master-set
that selects the correct page master for odd and even pages. E.g.:
<fo:page-sequence-master master-name="PageMaster">
<fo:repeatable-page-master-alternatives>
<fo:conditional-page-master-reference master-reference="OddPage" odd-or-even="odd"/>
<fo:conditional-page-master-reference master-reference="EvenPage" odd-or-even="even"/>
</fo:repeatable-page-master-alternatives>
</fo:page-sequence-master>
See https://www.w3.org/TR/xsl11/#fo_page-sequence-master and https://www.w3.org/TR/xsl11/#odd-or-even for more information.master-reference
on your fo:page-sequence
referring to the fo:page-sequence-master
. E.g.:
<fo:page-sequence master-reference="PageMaster">
Please also see the 'Switching between right and left page layouts' example PDF and FO in the 'XSL-FO Samples' page at https://www.antennahouse.com/xsl-fo-samples. There are other fo:page-sequence-master
samples on that page as well.
Upvotes: 1