Initial Page Number in Document

Top Previous Topic Next Topic  Print this topic

When starting a new page sequence, the xf:initial-page-number-in-document element determines if a blank page must be inserted before.

 

It has the same behaviour as fo:initial-page-number, the difference being that xf:initial-page-number-in-document is applied to the document's actual page count, regardless of the initial-page-number defined on the previous page sequence.

 

It has higher priority than fo:initial-page-number.

 

- type: enum

- values:

       - auto

       The initial folio number shall be set to 1 if no previous fo:page-sequence exists in the document.

       If a preceding page-sequence exists, the initial folio number will be one greater than the last number for that sequence.

 

       - auto-odd

       A value is determined in the same manner as for "auto". If that value is an even number 1 is added.

 

       - auto-even

       A value is determined in the same manner as for "auto". If that value is an odd number 1 is added.

 

       - multiple-of(x)

       The number of pages will be a multiple of the "x" integer set as value.

 

 

Example of usage:

 

 

1. xf:initial-page-number-in-document="multiple-of(3)"

 

 

<?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">

       <fo:layout-master-set>

               <fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="2.000in">

                       <fo:region-body region-name="xsl-region-body" margin="0.700in" />

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.700in"/>

                       <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>

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

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

               </fo:simple-page-master>

       </fo:layout-master-set>

       <fo:page-sequence master-reference="Letter Page" >

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>1st page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

       <fo:page-sequence master-reference="Letter Page" xf:initial-page-number-in-document="multiple-of(4)">

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>2nd page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

</fo:root>

 

 

Output:

 

initial-page-number-in-document1

2. xf:initial-page-number-in-document="auto-odd"

 

 

<?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">

       <fo:layout-master-set>

               <fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="2.000in">

                       <fo:region-body region-name="xsl-region-body" margin="0.700in" />

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.700in"/>

                       <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>

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

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

               </fo:simple-page-master>

       </fo:layout-master-set>

       <fo:page-sequence master-reference="Letter Page" >

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>1st page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

       <fo:page-sequence master-reference="Letter Page" xf:initial-page-number-in-document="auto-odd">

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>2nd page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

</fo:root>

 

 

Output:

 

initial-page-number-in-document2

3. xf:initial-page-number-in-document="auto-even"

 

<?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">

       <fo:layout-master-set>

               <fo:simple-page-master master-name="Letter Page" page-width="8.500in" page-height="2.000in">

                       <fo:region-body region-name="xsl-region-body" margin="0.700in" />

                       <fo:region-before region-name="xsl-region-before" display-align="after" extent="0.700in"/>

                       <fo:region-after region-name="xsl-region-after" display-align="before" extent="0.700in"/>

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

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

               </fo:simple-page-master>

       </fo:layout-master-set>

       <fo:page-sequence master-reference="Letter Page" >

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>1st page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

       <fo:page-sequence master-reference="Letter Page" >

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>2nd page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

       <fo:page-sequence master-reference="Letter Page" xf:initial-page-number-in-document="auto-even">

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

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

               </fo:static-content>

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

                       <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:static-content flow-name="xsl-region-end">

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

               </fo:static-content>

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

                       <fo:block>3rd page sequence</fo:block>

               </fo:flow>

       </fo:page-sequence>

</fo:root>

 

initial-page-number-in-document3