以下是XSL-FO奇数页,偶数页和空白页的定义和示例代码。
奇数页:
![](https://p-blog.csdn.net/images/p_blog_csdn_net/long_jj/EntryImages/20091209/1-4-oddpage.png)
偶数页:
![](https://p-blog.csdn.net/images/p_blog_csdn_net/long_jj/EntryImages/20091209/1-4-evenpage.png)
空白页:
![](https://p-blog.csdn.net/images/p_blog_csdn_net/long_jj/EntryImages/20091209/1-4-blankpage.png)
示例代码:
<?xml version="1.0" encoding="UTF-8"?> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"> <fo:layout-master-set> <fo:simple-page-master master-name="odd-page" page-width="8.48in" page-height="10.98in" margin-top="0.4in" margin-bottom="0.4in"> <fo:region-body region-name="xsl-region-body" margin-top="1in" margin-bottom="1in" margin-left="1.2in" margin-right="0.4in"/> <fo:region-before region-name="xsl-region-odd-before" extent="1in"/> <fo:region-after region-name="xsl-region-odd-after" extent="1in"/> <fo:region-start region-name="xsl-region-odd-start" extent="1.2in"/> <fo:region-end region-name="xsl-region-odd-end" extent="0.4in"/> </fo:simple-page-master> <fo:simple-page-master master-name="even-page" page-width="8.48in" page-height="10.98in" margin-top="0.4in" margin-bottom="0.4in"> <fo:region-body region-name="xsl-region-body" margin-top="1in" margin-bottom="1in" margin-left="0.4in" margin-right="1.2in" /> <fo:region-before region-name="xsl-region-even-before" extent="1in"/> <fo:region-after region-name="xsl-region-even-after" extent="1in"/> <fo:region-start region-name="xsl-region-even-start" extent="0.4in"/> <fo:region-end region-name="xsl-region-even-end" extent="1.2in"/> </fo:simple-page-master> <fo:simple-page-master master-name="blank-page" page-width="8.48in" page-height="10.98in" margin-top="0.4in" margin-bottom="0.4in"> <fo:region-body region-name="xsl-region-body" margin-top="1in" margin-bottom="1in" margin-left="1.2in" margin-right="0.4in" /> <fo:region-before region-name="xsl-region-blank-before" extent="6in"/> <fo:region-after region-name="xsl-region-blank-after" extent="1in"/> <fo:region-start region-name="xsl-region-blank-start" extent=".4in"/> <fo:region-end region-name="xsl-region-blank-end" extent="1.2in"/> </fo:simple-page-master> <fo:page-sequence-master master-name="section"> <fo:repeatable-page-master-alternatives> <fo:conditional-page-master-reference blank-or-not-blank="not-blank" odd-or-even="odd" master-reference="odd-page"/> <fo:conditional-page-master-reference blank-or-not-blank="not-blank" odd-or-even="even" master-reference="even-page"/> <fo:conditional-page-master-reference blank-or-not-blank="blank" master-reference="blank-page"/> </fo:repeatable-page-master-alternatives> </fo:page-sequence-master> </fo:layout-master-set> <fo:page-sequence master-reference="section" force-page-count="even"> <fo:static-content flow-name="xsl-region-blank-before"> <fo:block text-align="left" border-bottom="1pt solid black" font-style="italic" margin-top="0.5in"> Page - <fo:page-number/></fo:block> <fo:block space-before="100mm" text-align="center" font-weight="bold">INTENTIONALLY LEFT BLANK</fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-odd-before"> <fo:block text-align="right" border-bottom="1pt solid black" font-style="italic" margin-top="0.5in"> Page - <fo:page-number/></fo:block> </fo:static-content> <fo:static-content flow-name="xsl-region-even-before"> <fo:block text-align="left" border-bottom="1pt solid black" font-style="italic" margin-top="0.5in"> Page - <fo:page-number/></fo:block> </fo:static-content> <fo:flow flow-name="xsl-region-body"> <fo:block space-before="10pt" space-after="10pt"> This document has been reviewed by W3C Members and other interested parties and has been endorsed by the Director as a W3C Recommendation. It is a stable document and may be used as reference material or cited as a normative reference from another document. W3C's role in making the Recommendation is to draw attention to the specification and to promote its widespread deployment. This enhances the functionality and interoperability of the Web. </fo:block> <fo:block space-before="10pt" space-after="10pt"> The system-font function returns a characteristic of a system font. The first argument is the name of the system font and the second argument, which is optional, names the property that specifies the characteristic. If the second argument is omitted, then the characteristic returned is the same as the name of the property to which the expression is being assigned. </fo:block> <fo:block space-before="10pt" space-after="10pt"> The background-color property on the fo:block is assigned the value "red" because the (computed, after inheritance) value of the color (not background-color) property on the fo:list-item-body that is the parent of fo:block is "red". </fo:block>
<fo:block space-before="10pt" space-after="10pt">
...
</fo:block>
<fo:block space-before="10pt" space-after="10pt"> The fo:bookmark formatting object is used to identify an access point, by name, and to specify where that access point is within the current document or another external document. A given bookmark may be further subdivided into a sequence of (sub-)bookmarks to as many levels as the authors desire. </fo:block> </fo:flow> </fo:page-sequence> </fo:root>