Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XSL-FO region-body Object

XSL-FO region-body Object

XSL-FO Reference Manual XSL-FO Reference Manual


Definition and Usage

fo:region-body The object defines the body area of a page.

XSL-FO uses the following elements to define page areas:

**Note:** region-before, region-after, region-start, and region-end are all part of region-body. To prevent text in region-body from overlapping text in other areas, the margins of region-body must be at least as large as the dimensions of these four sub-areas.

**Tip:** To provide multiple columns in the region-body area, set the column-count property to greater than 1! /p>

**Note:** If the value of the overflow property is "scroll", you cannot set the column-count property to greater than 1!

**Note:** According to the XSL-FO 1.0 recommendation, the padding and border-width properties must be 0.


Syntax

fo:region-body

property

Properties [A-B] Properties [C-Z]
background-attachment clip
background-color column-count
background-image column-gap
background-repeat display-align
background-position-horizontal end-indent
background-position-vertical margin-bottom
border-after-color margin-left
border-after-style margin-right
border-after-width margin-top
border-before-color overflow
border-before-style padding-after
border-before-width padding-before
border-bottom-color padding-bottom
border-bottom-style padding-end
border-bottom-width padding-left
border-end-color padding-right
border-end-style padding-start
border-end-width padding-top
border-left-color region-name
border-left-style reference-orientation
border-left-width space-after
border-right-color space-before
border-right-style writing-mode
border-right-width
border-start-color
border-start-style
border-start-width
border-top-color
border-top-style
border-top-width

Example 1

XSL-FO uses page templates called "Page Masters" to define page layouts. Each template must have a unique name:

In the example above, three fo:simple-page-master elements define three different templates. Each template (page-master) has a different name.

The first template is named "intro". It can be used as a template for the introduction page.

The second and third templates are named "left" and "right". They can be used as templates for even and odd page numbers.

Example 2

This is a fragment extracted from an XSL-FO document:

page-width="297mm" page-height="210mm"

margin-top="1cm" margin-bottom="1cm"

margin-left="1cm" margin-right="1cm">

The code above defines a "Simple Page Master Template" named "A4".

The page width is 297 mm and the height is 210 mm.

The four margins of the page (top, bottom, left, right) are all 1 cm.

The margins of the body are 3 cm (on all four sides).

The before, after, start, and end areas of the body are all 2 cm.

The width of the body in the example above can be calculated by subtracting the left and right margins and the region-body margins from the page width:

297mm - (2 x 1cm) - (2 x 3cm) = 297mm - 20mm - 60mm = 217mm

Note that regions (region-start and region-end) are not counted. As explained earlier, these regions are part of the body.


XSL-FO Reference Manual XSL-FO Reference Manual