web analytics
Page Regions in XSL-FO Options
codeling
Posted: Tuesday, March 22, 2016 9:08:15 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 982
Points: 4134

XSL-FO uses the following elements to define the regions of a page:

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

Only fo:region-body is required.  The followingfigure shows one arrangement of the regions:

Note: region-before, region-after, region-start, and region-end is a part of the region-body. To avoid text in the region-body to overwrite text in the other regions, the region-body must have margins at least the size of these regions.

Sponsor
Posted: Tuesday, March 22, 2016 9:08:15 AM
codeling
Posted: Tuesday, March 22, 2016 9:13:00 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 982
Points: 4134

Regions have default names

Regions have names, and content is directed to the page regions based on the region’s name. The following figure shows the default, initial name for each page region FO, which just happens to look a lot like the FO’s name, such as “xsl-region-body” for fo:region-body.

codeling
Posted: Tuesday, March 22, 2016 9:24:13 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 982
Points: 4134

Use your own names

But you don’t have to stick with the initial names. You can define the regions with any name, such as “my-before”, “my-end”, or even “George”, provided it’s:

  • A valid name. It has to be, in XML terminology, a NCName, which means, e.g., it can’t contain a colon and has to start with a letter (or other allowed character).
  • Unique within the region names for the page master
  • Not the initial name for a different class of region: i.e., you can’t call your fo:region-before “xsl-region-after” and expect things to work

An additional proviso that works across page masters is that you can’t use the same name on different region types on different page masters. So “George” can’t be a fo:region-before on one page master and fo:region-start on another.

The flip-side of the proviso above is that you can use the same region name for the same region on different page masters.  

codeling
Posted: Monday, September 25, 2017 9:28:33 AM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 982
Points: 4134

The margins you set for the region-body must be greater than or equal to the extents of the the region-before and region-after. If you do something like this:

<fo:region-before extent="1cm"/>

<fo:region-after extent="1cm"/>

<fo:region-body

    margin-top="0.20cm"

    margin-bottom="0.20cm" />

you can expect results like

Text overwrites heading
Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2018 Digcode.com. All rights reserved.