当前位置: 首页 > 网络学院 > XML相关教程 > XSL-FO > XSL-FO simple-page-master 对象
The <fo:simple-page-master> object defines the size and shape of a page. There will be one named simple-page-master for each page layout.
<fo:simple-page-master>对象定义了一个页面的尺寸和形状。对于每个页面层来说,都包含一个指定的simple-page-master [简单页面主]。
A page can contain up to five regions: region-body, region-before, region-after, region-start, and region-end.
一个页面最多可以包含五个区域:region-body[主体区]、region-before[前区]、region-after[后区]、region-start[起始区]、region-end[终止区]。
The <fo:simple-page-master> will be referenced from a <fo:page-sequence-master> object or from a <fo:page-sequence> object.
<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> |
属性 |
---|
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 |
XSL-FO documents have a structure like this:
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> |
A "real" XSL-FO example:
一个现实中的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 W3Schools</fo:block> </fo:flow> </fo:page-sequence> </fo:root> |
The output from the code above would be something like this:
上述代码将输出下面的结果:
Hello W3Schools
|