Auto Adjust Regions

Top Previous Topic Next Topic  Print this topic

This section describes an extension used to auto-adjust regions from page (region-before and region-body): xf:auto-adjust-regions .

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

 

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"

               xmlns:xf="http://www.ecrion.com/xf/1.0"> (1)

 <fo:layout-master-set>

       <fo:simple-page-master master-name="all-pages"

                       page-width="8.5in" page-height="3.5in"

                               xf:auto-adjust-regions="true"> (2)

               <fo:region-body region-name="xsl-region-body"

               column-gap="0.25in" padding="6pt" margin="0.7in"/>

               <fo:region-before region-name="xsl-region-before"

               display-align="after" extent="0.7in" padding="6pt"/>

               <fo:region-after region-name="xsl-region-after"

               display-align="before" extent="0.7in" padding="6pt"/>

       </fo:simple-page-master>

       <fo:page-sequence-master master-name="default-sequence">

               <fo:repeatable-page-master-reference

                                       master-reference="all-pages"/>

       </fo:page-sequence-master>

 </fo:layout-master-set>

 <fo:page-sequence master-reference="default-sequence">

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

                       font-size="12pt" font-family="Times New Roman">

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

               <fo:block>header</fo:block>

       </fo:static-content>

       <fo:static-content flow-name="xsl-region-after"

                       font-size="12pt" font-family="Times New Roman">

               <fo:block>footer</fo:block>

               <fo:block>footer</fo:block>

               <fo:block>footer</fo:block>

       </fo:static-content>

       <fo:flow flow-name="xsl-region-body" font-size="12pt"

                               font-family="Times New Roman">

               <fo:block>body</fo:block>

               <fo:block>body</fo:block>

               <fo:block>body</fo:block>

       </fo:flow>

 </fo:page-sequence>

</fo:root>

 

The important points in this example are:

 

(1) In order to work with extension you must have the corresponding xml namespace defined.

(2) xf:auto-adjust-regions applies to fo:simple-page-master and can take one of the values: "true" |"false". Set on "true" is auto-adjusting page regions by their content.