You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Rodolphe VAGNER <ro...@eurodoc-sofilog.com> on 2002/03/26 17:22:59 UTC

force-count-page : end on even

Hy,

My format of footpage is :

page x on X

But it seems that the forced page is not counted !

( my last page is 'page 42 on 41'  !!!)

Is there a solution ?



Re: force-count-page : end on even

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Rodolphe VAGNER wrote:
> Ok, I understand the idea, and my problem.
> The next one is where should I insert the static content for this blank page
> ?
Oops, scratch the idea, FOP doesn't implement the
necessary prerequisites as noted by Tim.

The other two possibilities i can think of resort to
Java hacking.

The first: Let your style sheet take the total number
of pages as a parameter instead of using
fo:page-number-citation. Make a first formatting pass
with an unset total, pipe the result into the null
device. Get the total number of pages from the
formatter, see:
  http://marc.theaimsgroup.com/?l=fop-dev&m=101496996819500&w=2
Make a second pass, this time passing the total to
the XSLT processor. Even though you are formatting
the document two times, it is possible you are as
fast as with one pass, because there is no ugly
forward reference to the last page.

The second: Implement an extension element which returns
the total number of pages. This may be quite tricky, as
far as i can see this wont fit easily with the stream
rendering attempts.

HTH
J.Pietschmann


Re: force-count-page : end on even

Posted by Rodolphe VAGNER <ro...@eurodoc-sofilog.com>.
Ok, I understand the idea, and my problem.
The next one is where should I insert the static content for this blank page
?
In the page sequence (I have only one) ?

And if my text is long enought to fill 40 pages there will be no block with
my 'id' to count pages, no ?


----- Original Message -----
From: "J.Pietschmann" <j3...@yahoo.de>
To: <fo...@xml.apache.org>
Sent: Tuesday, March 26, 2002 10:08 PM
Subject: Re: force-count-page : end on even


> Rodolphe VAGNER wrote:
> > My format of footpage is :
> > page x on X
> > But it seems that the forced page is not counted !
>
> I suppose you retrieve the page count using the standard
> method: put a (usually empty) block at the end of the
> flow and use the page-number-citation referring to this
> block to get the total number X.
> If you have text up to page 41, the last block ends up on
> page 41, and X renders as 41. If you force even pages,
> the block is *still* on page 41, and X renders as 41.
> Bad luck!
> Time for some more creativity. A suggestion: Use a
> page-sequence-master contaqining a conditional page
> sequence with a separate master for the last page.
> Put the block referenced for the last page number into
> the static content of the last page.
>
> HTH
> J.Pietschmann
>


Re: force-count-page : end on even

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Rodolphe VAGNER wrote:
> My format of footpage is :
> page x on X
> But it seems that the forced page is not counted !

I suppose you retrieve the page count using the standard
method: put a (usually empty) block at the end of the
flow and use the page-number-citation referring to this
block to get the total number X.
If you have text up to page 41, the last block ends up on
page 41, and X renders as 41. If you force even pages,
the block is *still* on page 41, and X renders as 41.
Bad luck!
Time for some more creativity. A suggestion: Use a
page-sequence-master contaqining a conditional page
sequence with a separate master for the last page.
Put the block referenced for the last page number into
the static content of the last page.

HTH
J.Pietschmann