定义和用法
The <fo:simple-page-master> 对象定义了一个页面的尺寸和形状。对于每个页面布局来说,都包含一个指定的 simple-page-master。
一个页面最多可以包含五个区域:region-body、region-before、region-after、region-start、region-end。
<fo:simple-page-master> 对象将从 <fo:page-sequence-master> 对象或<fo:page-sequence> 对象中引用。
语法
<fo:simple-page-master>
<!--
Contents:(region-body,region-before?,
region-after?,region-start?,region-end?)
-->
</fo:simple-page-master>
<!--
Contents:(region-body,region-before?,
region-after?,region-start?,region-end?)
-->
</fo:simple-page-master>
属性
属性 |
---|
end-indent |
margin-bottom |
margin-left |
margin-right |
margin-top |
master-name |
page-height |
page-width |
reference-orientation |
space-after |
space-before |
start-indent |
writing-mode |
实例 1
XSL-FO 文档结构如下所示:
<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<!-- Page template goes here -->
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<!-- Page content goes here -->
</fo:page-sequence>
</fo:root>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<!-- Page template goes here -->
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<!-- Page content goes here -->
</fo:page-sequence>
</fo:root>
实例 2
一个"真实的" XSL-FO 实例:
<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello RUNOOB</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
</fo:simple-page-master>
</fo:layout-master-set>
<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello RUNOOB</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
上面代码的输出如下所示:
Hello RUNOOB
|
XSL-FO 参考手册