Re: [xsl] xsl:fo page numbering on alternate sides

Subject: Re: [xsl] xsl:fo page numbering on alternate sides
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Thu, 20 Jan 2005 07:11:10 -0500
At 2005-01-20 11:01 +0000, Dev Anand wrote:
I have a problem with the page numbering.The result of my xsl:fo PDF file is printed like a book..
So this would mean that the page numberings should come alternatively in the right and left corner in the bottom of the page for even and odd numbered pages respectively. Is there some way of automatically producing this ?? I

Point your page-sequence to a page-sequence-master that defines a repeatable sequence of alternatives between two conditional-page-master-references: one testing page parity for odd page numbers and the other testing page parity for even page numbers.


The two simple-page-masters that you point to need then to define differently-named region-after extents, one used as the odd-page and one for the even-page.

Your page sequence then defines two pieces of static content, one with the page number on the right for the region-after named in the odd page master, and one with the page number on the left for the region-after named in the even page master.

The formatter will obtain "the next page" from the page sequence that alternates between the two page masters and you will get alternating footers.

I hope this helps.

............................... Ken

p.s. here is an example for headers that you can adapt for footers:

<layout-master-set>
<simple-page-master master-name="frame-odd"
page-height="&page-height;" page-width="&page-width;"
margin-top="&margin-top;" margin-bottom="&margin-bottom;"
margin-left="&margin-left;" margin-right="&margin-right;">
<region-body region-name="frame-body"
margin-top="&before-extent;" margin-bottom="&after-extent;"/>
<region-before extent="&before-extent;" region-name="frame-before-o"/>
</simple-page-master>
<simple-page-master master-name="frame-even"
page-height="&page-height;" page-width="&page-width;"
margin-top="&margin-top;" margin-bottom="&margin-bottom;"
margin-left="&margin-left;" margin-right="&margin-right;">
<region-body region-name="frame-body"
margin-top="&before-extent;" margin-bottom="&after-extent;"/>
<region-before extent="&before-extent;" region-name="frame-before-e"/>
</simple-page-master>
<page-sequence-master master-name="frame-pages">
<repeatable-page-master-alternatives>
<conditional-page-master-reference odd-or-even="even"
master-reference="frame-even"/>
<conditional-page-master-reference odd-or-even="odd"
master-reference="frame-odd"/>
</repeatable-page-master-alternatives>
</page-sequence-master>
</layout-master-set>


<page-sequence master-reference="frame-pages" force-page-count="even">

<static-content flow-name="frame-before-e">
  <block>frame-even - <page-number/></block>
</static-content>
<static-content flow-name="frame-before-o">
  <block>frame-odd - <page-number/></block>
</static-content>

<flow flow-name="frame-body" font-size="40pt">
  <block...>


-- World-wide on-site corporate, govt. & user group XML/XSL training. G. Ken Holman mailto:gkholman@xxxxxxxxxxxxxxxxxxxx Crane Softwrights Ltd. http://www.CraneSoftwrights.com/s/ Box 266, Kars, Ontario CANADA K0A-2E0 +1(613)489-0999 (F:-0995) Male Breast Cancer Awareness http://www.CraneSoftwrights.com/s/bc Legal business disclaimers: http://www.CraneSoftwrights.com/legal

Current Thread