Auto Adjust Regions

Top Previous Topic Next Topic  Print this topic

The xf:auto-adjust-regions extension is used for fitting larger content in the page regions (region-after, region-start, region-end, region-before) without overlapping their extent over the region-body.

 

It can be applied only to fo:simple-page-master and supports Boolean values.

 

Example of usage:

 

 

<?xml version="1.0" encoding="utf-8" ?>

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:xf="http://www.ecrion.com/xf/1.0" xmlns:xc="http://www.ecrion.com/2008/xc" xmlns:svg="http://www.w3.org/2000/svg" font-family="Times" font-size="12pt">(1)

       <fo:layout-master-set>

               <fo:simple-page-master master-name="Letter Page" page-width="8.5in" page-height="5in" xf:auto-adjust-regions="true">(2)

                       <fo:region-body region-name="xsl-region-body" background-color="red" margin="0.7in"/>

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="1.1in" background-color="green"/>

                       <fo:region-after region-name="xsl-region-after" extent="1.1in" background-color="yellow"/>

                       <fo:region-start region-name="xsl-region-start" extent="0.7in"/>

                       <fo:region-end region-name="xsl-region-end" extent="0.7in"/>

               </fo:simple-page-master>

       </fo:layout-master-set>

       <fo:page-sequence master-reference="Letter Page"><fo:static-content flow-name="xsl-region-after">

                       <fo:block><fo:inline font-size="16pt" font-weight="bold">FOOTER</fo:inline></fo:block>

               </fo:static-content><fo:static-content flow-name="xsl-region-before">

                       <fo:block><fo:inline font-weight="bold" font-size="16pt">HEADER</fo:inline></fo:block>

               </fo:static-content><fo:static-content flow-name="xsl-region-end">

                       <fo:block>&#x00A0;</fo:block>

               </fo:static-content><fo:static-content flow-name="xsl-region-start">

                       <fo:block>&#x00A0;</fo:block>

               </fo:static-content><fo:flow flow-name="xsl-region-body">

                       <fo:block><fo:inline font-weight="bold" font-size="16pt">BODY</fo:inline></fo:block>

               </fo:flow>

       </fo:page-sequence>

</fo:root>

 

 

Key observations:

1. In order to work with the extension, the corresponding xml namespace must be defined.

2. xf:auto-adjust-regions applies to fo:simple-page-master and can have one of the following values: "true" or "false". When its value is set to "true", it automatically adjusts the page regions according to all the other regions' extent.

 

Using xf:auto-adjust-regions set to "true":

 

adjust-regions2

 

 

Using xf:auto-adjust-regions set to "false":

 

adjust-regions1