The best XSL-FO page Tutorial In 2024, In this tutorial you can learn XSL-FO page template (Page Templates),XSL-FO Page Size (Page Size),XSL-FO page margins (Page Margins),XSL-FO Region (Page Regions),XSL-FO instances,
XSL-FO uses page templates called "Page Masters" to define the layout of the page.
XSL-FO uses page templates called "Page Masters" to define the layout of the page. Each template must have a unique name:
In the example above, the three <fo: simple-page-master> element defines three different templates. Each template (page-master) has a different name.
The first template named "intro". It can be used as a template for introduction pages.
The second and third templates called "left" and "right". They can be as even and odd numbered pages template.
XSL-FO using the following attributes define the size of the page:
XSL-FO using margin following attribute definition page:
XSL-FO using the following element defines a page area:
Please note, region-before, region-after, region-start and region-end is part of the main area. To avoid text body text area to cover these areas, the main area of the margin at least equal to the size of other districts.
This is a fragment extracted from an XSL-FO document:
The above code defines a name for the "A4" of "Simple Page Master Template".
Page width is 297 mm, height 210 mm.
Four page margins (margins on the bottom, left margin, right margin) is 1 cm.
Margins body is 3 cm (all four sides).
before the body, after, start and end zones are 2 cm.
The width of the main examples above may be reduced by about margins and the region-body margins calculated by the width of the page:
297mm - (2 x 1cm) - (2 x 3cm) = 297mm - 20mm - 60mm = 217mm
Please note, region (region-start and region-end) is not counted. As previously explained earlier, these zones (region) is an integral part of the body.