YouTip LogoYouTip

Obj Region Start

XSL-FO Reference Manual XSL-FO Reference Manual


Definition and Usage

The <fo:region-start> object defines the left area of the page (left sidebar).

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

  • <fo:region-body> defines the body area
  • <fo:region-before> defines the top area (header)
  • <fo:region-after> defines the bottom area (footer)
  • <fo:region-start> defines the left area (left sidebar)
  • <fo:region-end> defines the right area (right sidebar)

Note: region-before, region-after, region-start, and region-end are all part of region-body. To prevent the text in region-body from overlapping other regions, the margins of region-body must be at least the same size as those of the four sub-regions.

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


Syntax

<fo:region-start>

<!--

 Contents:EMPTY

 -->

</fo:region-start>

Attributes

Attributes Attributes
background-attachment clip
background-color display-align
background-image extent
background-repeat overflow
background-position-horizontal padding-after
background-position-vertical padding-before
border-after-color padding-bottom
border-after-style padding-end
border-after-width padding-left
border-before-color padding-right
border-before-style padding-start
border-before-width padding-top
border-bottom-color region-name
border-bottom-style reference-orientation
border-bottom-width writing-mode
border-end-color
border-end-style
border-end-width
border-left-color
border-left-style
border-left-width
border-right-color
border-right-style
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:

<fo:simple-page-master master-name="intro">
  <fo:region-body margin="5in" />
</fo:simple-page-master>

<fo:simple-page-master master-name="left">
  <fo:region-body margin-left="2in" margin-right="3in" />
</fo:simple-page-master>

<fo:simple-page-master master-name="right">
  <fo:region-body margin-left="3in" margin-right="2in" />
</fo:simple-page-master>

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 an introduction page.

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

Example 2

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

<fo:simple-page-master master-name="A4"
  page-width="297mm" page-height="210mm"
  margin-top="1cm" margin-bottom="1cm"
  margin-left="1cm" margin-right="1cm">
  <fo:region-body margin="3cm"/>
  <fo:region-before extent="2cm"/>
  <fo:region-after extent="2cm"/>
  <fo:region-start extent="2cm"/>
  <fo:region-end extent="2cm"/>
</fo:simple-page-master>

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

The page width is 297 mm, height is 210 mm.

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

The body margin is 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 as page width minus left/right margins and region-body margins:

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

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


XSL-FO Reference Manual XSL-FO Reference Manual

← Obj Repeatable Page Master AltObj Region End β†’