XSL-FO วัตถุง่ายหน้าหลัก
ถัดไป: XSL-FO เดียว page- ต้นแบบอ้างอิง วัตถุ
ความหมายและการใช้งาน
ส่วน <สำหรับ: ง่ายหน้าหลัก> วัตถุกำหนดขนาดและรูปร่างของหน้า สำหรับรูปแบบแต่ละหน้าก็มีระบุง่ายหน้าหลัก
หน้าสามารถมีได้ถึงห้าพื้นที่ภาคร่างกายภูมิภาคก่อนภูมิภาคหลังจากภูมิภาคเริ่มต้นภาคปลาย
<Fo: ง่ายหน้าหลัก> วัตถุจาก <สำหรับ: หน้าลำดับ-Master> วัตถุหรือ <สำหรับ: หน้าลำดับ> อ้างอิงวัตถุ
ไวยากรณ์
<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 W3CSchool</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 W3CSchool</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
การส่งออกของโค้ดข้างต้นจะเป็นดังนี้:
สวัสดี W3CSchool |
คู่มืออ้างอิง XSL-FO
ถัดไป: XSL-FO เดียว page- ต้นแบบอ้างอิง วัตถุ