W3C home > Mailing lists > Public > www-xsl-fo@w3.org > September 2002

RE: Page X of Y

From: Al-Dhahir, Haitham <Haitham.Al-Dhahir@gs.com>
Date: Tue, 17 Sep 2002 16:49:25 +0100
Message-Id: <F17B2FF57CF8D41196CC0008C786CEAA0B57238E@gsln14e.ln.fw.gs.com>
To: www-xsl-fo@w3.org

Thanks Ken and Mike. The Page X of Y solution works fine!

However, I'm still having problems with the page-sequence-master.

To clarify: The document I am trying to generate is at least 1 page long and
at most 2 pages long. Hence, I have created the following layout-master-set:

	<fo:page-sequence-master master-name="seq-master">
page-position="first" master-name="first"/>
page-position="rest" master-name="rest"/>

	<fo:simple-page-master master-name="first" page-height="29.7cm"
page-width="21cm" margin-top="0cm" margin-bottom="0.5cm" margin-left="1.5cm"
		<fo:region-before extent="0.8cm"/>
		<fo:region-body margin-top="0.8cm"/>
		<fo:region-after extent="0.5cm"/>

	<fo:simple-page-master master-name="rest" page-height="29.7cm"
page-width="21cm" margin-top="0cm" margin-bottom="0.5cm" margin-left="1.5cm"
		<fo:region-body margin-top="0.8cm"/>
		<fo:region-before extent="2cm"
		<fo:region-after extent="0.5cm"/>

The rest of my XSL is then:

<fo:page-sequence master-reference="seq-master" initial-page-number="1">
	<fo:static-content flow-name="rest-before-region">
		<fo:block text-align="start" font-weight="normal">HEADING
	<fo:flow flow-name="xsl-region-body">


The idea is that "HEADING TEXT FOR PAGES AFTER PAGE 1" will appear at the
top of page 2, but not on page 1. However, when I try to convert this into
PDF using the FOP renderer, Xalan throws a TransformerException and FOP then
throws a NullPointerException. I have tried converting using the example XSL
at http://www.dpawson.co.uk/xsl/sect3/evenodd.html and even then the same
error is thrown. Can anyone help? Is there anything obviously wrong with my
use of page-sequence-master in the above XSL?



-----Original Message-----
From: Mike Haarman [mailto:mhaarma@socsci.umn.edu]
Sent: 16 September 2002 17:45
To: www-xsl-fo@w3.org
Subject: Re: Page X of Y

On Mon, 16 Sep 2002, Al-Dhahir, Haitham wrote:

> I have a multi-page document, and on each page I'd like to display the
> number. However, I want to display this in the form:
> Page X of Y

<fo:block>Page <fo:page-number/> of
<fo:page-number-citation ref-id="endofdoc"/></fo:block>

And place an empty block labled "endofdoc" at the end of the content of
the document like so:

<fo:block id="endofdoc"/>

> A follow-up question: if I have a two-page document, and I want the page
> number to be displayed in a different position on the second page than it
> on the first page, how can I achieve this?

The following article contains an nice discussion of how to accomplish
this.  You'll use fo:repeatable-page-master-alternatives:


> Many thanks,

Many welcomes.

Mike Haarman
Received on Tuesday, 17 September 2002 11:49:55 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:58:26 UTC