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 sascha <sa...@assbach.de> on 2002/07/24 09:53:39 UTC

page x of y

hi,

when i was looking for a solution on that one in the archive
i found a solution from J.Pietschmann with some kind of a function.

But as far as i understand, the document is rendered 2 times,
this means the process takes double time, right? ( or is at least
longer... )

Is there really no simpler way? a faster one?
And if not, how and where in my document do i place this "function"?

thanks again,
sascha


Re: Numbering of pages

Posted by Chuck Paussa <Ch...@systems.dhl.com>.
 >>>> MARTIN Franck wrote:
 >>>> What do you mean exactly? Could you provide me with some sample 
code please?
 >>> Keiron Liddle wrote:
 >>> Both of these problems sound like they could be done with markers.
 >>> Look in docs/examples/markers/.
 >>> In the flow you specify a marker in side a block. The static region can
 >>> then retrieve a marker. If there is a marker specified on the page 
(with
 >>> appropraite class) then the contents of the marker are placed in the
 >>> static region.
 >> Antonio Fiol Bonnin wrote:
 >> This seems to be exactly the solution for what I was struggling about.
 >>
 >> For the page numbering problem, it might be a little more difficult,
 >> however. I will definitely have a look in the stated directory.
 > Arved Sandstrom wrote:
 >
 > One thing to keep in mind with markers - they must be the _first_ 
children
 > of an FO (that supports them). I can't recall how rigid we are with 
respect
 > to enforcing this, but it's possible that if you prettify your FO, 
and there
 > is a newline (unsuppressed) between the block start tag and the 
marker start
 > tag, that this will be rejected.
 >
 > Regards,
 > Arved Sandstrom
Actually FOP is rather loose with markers. It complains mightily when 
you don't follow the standard but then, processes things anyway. This 
behavior is the work-around for the first-including-carryover problem. 
To enable that attribute value, you need to place the marker as the 
"last" value in the block. Here's a link to some sample code 
http://marc.theaimsgroup.com/?l=fop-dev&m=100897905110034&w=2

Chuck Paussa



RE: Numbering of pages

Posted by Arved Sandstrom <Ar...@chebucto.ns.ca>.
> -----Original Message-----
> From: Antonio Fiol Bonnin [mailto:fiol@w3ping.com]
> Sent: July 26, 2002 7:22 AM
> To: fop-user@xml.apache.org
> Subject: Re: Numbering of pages
>
>
> Keiron Liddle wrote:
>
> >On Fri, 2002-07-26 at 10:50, MARTIN Franck wrote:
> >
> >
> >>>>Both of these problems sound like they could be done with markers.
> >>>>
> >>>>
> >>What do you mean exactly? Could you provide me with some sample
> code please?
> >>
> >>
> >
> >Look in docs/examples/markers/.
> >
> >In the flow you specify a marker in side a block. The static region can
> >then retrieve a marker. If there is a marker specified on the page (with
> >appropraite class) then the contents of the marker are placed in the
> >static region.
> >
> This seems to be exactly the solution for what I was struggling about.
>
> For the page numbering problem, it might be a little more difficult,
> however. I will definitely have a look in the stated directory.

One thing to keep in mind with markers - they must be the _first_ children
of an FO (that supports them). I can't recall how rigid we are with respect
to enforcing this, but it's possible that if you prettify your FO, and there
is a newline (unsuppressed) between the block start tag and the marker start
tag, that this will be rejected.

Regards,
Arved Sandstrom


Re: Numbering of pages

Posted by Antonio Fiol Bonnín <fi...@w3ping.com>.
Keiron Liddle wrote:

>On Fri, 2002-07-26 at 10:50, MARTIN Franck wrote:
>  
>
>>>>Both of these problems sound like they could be done with markers.
>>>>        
>>>>
>>What do you mean exactly? Could you provide me with some sample code please?
>>    
>>
>
>Look in docs/examples/markers/.
>
>In the flow you specify a marker in side a block. The static region can
>then retrieve a marker. If there is a marker specified on the page (with
>appropraite class) then the contents of the marker are placed in the
>static region.
>
This seems to be exactly the solution for what I was struggling about.

For the page numbering problem, it might be a little more difficult, 
however. I will definitely have a look in the stated directory.


Antonio Fiol


Re: Numbering of pages

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Pierre-Yves Chauveau wrote:
> The current implementation can only get markers from the same page, so that
> might a problem.

This is fixed in CVS maintenance branch, you cen now get markers
from other pages (well, with some caveats, best to put a page-number
citation with a non-existent ref-id on the first page).

J.Pietschmann


Re: Numbering of pages

Posted by Pierre-Yves Chauveau <pi...@manpower.fr>.
The current implementation can only get markers from the same page, so that
might a problem. The best way (I think) is to do a different page-sequence
for each mail. Therefore, there is going to be different page numbers for
each mail. You will be able also to render a different header/footer for
each page sequence(mail).
Hope it 'll help.
Ex:
   <fo:layout-master-set>
    <fo:simple-page-master master-name="all" page-height="297mm"
page-width="210mm" margin-top="10mm" margin-bottom="10mm" margin-left="10mm"
margin-right="10mm">
     <fo:region-body margin-top="20mm" margin-bottom="15mm"/>
     <fo:region-before extent="25mm"/>
     <fo:region-after extent="10mm"/>
    </fo:simple-page-master>
   </fo:layout-master-set>
   <xsl:for-each select="mail">
    <fo:page-sequence master-reference="all" format="1"
initial-page-number="1">
     <!-- zone d'en-tête -->
     <fo:static-content flow-name="xsl-region-before">
      <!-- A passer en table car inline n'accepte pas les text-align-->
      <fo:block text-align="center" font-size="26pt" font-family="serif"
font-weight="bold">
      <xsl:value-of-select ="address"/>    </fo:block>
     </fo:static-content>
     <!-- zone de bas de page-->
     <fo:static-content flow-name="xsl-region-after">
          <fo:block font-size="10pt" font-family="serif" line-height="1em +
2pt"> page <fo:page-number/>
     </fo:static-content>
     <fo:flow flow-name="xsl-region-body">
      <fo:block break-before="page">
       <xsl:apply-templates select="."/>
      </fo:block>
     </fo:flow>
    </fo:page-sequence>
   </xsl:for-each>

Pierre-Yves Chauveau

----- Original Message -----
From: "Keiron Liddle" <ke...@aftexsw.com>
To: <fo...@xml.apache.org>
Sent: Friday, July 26, 2002 10:56 AM
Subject: Re: Numbering of pages


> On Fri, 2002-07-26 at 10:50, MARTIN Franck wrote:
> > >>Both of these problems sound like they could be done with markers.
> >
> > What do you mean exactly? Could you provide me with some sample code
please?
>
> Look in docs/examples/markers/.
>
> In the flow you specify a marker in side a block. The static region can
> then retrieve a marker. If there is a marker specified on the page (with
> appropraite class) then the contents of the marker are placed in the
> static region.
>
> > Thanks
>
>


Re: Numbering of pages

Posted by Keiron Liddle <ke...@aftexsw.com>.
On Fri, 2002-07-26 at 10:50, MARTIN Franck wrote:
> >>Both of these problems sound like they could be done with markers.
> 
> What do you mean exactly? Could you provide me with some sample code please?

Look in docs/examples/markers/.

In the flow you specify a marker in side a block. The static region can
then retrieve a marker. If there is a marker specified on the page (with
appropraite class) then the contents of the marker are placed in the
static region.

> Thanks



Re: Numbering of pages

Posted by MARTIN Franck <fr...@c-s.fr>.
>>Both of these problems sound like they could be done with markers.

What do you mean exactly? Could you provide me with some sample code please?

Thanks

----- Original Message -----
From: "Keiron Liddle" <ke...@aftexsw.com>
To: <fo...@xml.apache.org>
Sent: Friday, July 26, 2002 10:18 AM
Subject: Re: Numbering of pages



Both of these problems sound like they could be done with markers.

On Fri, 2002-07-26 at 08:16, Antonio Fiol Bonnín wrote:
> MARTIN Franck wrote:
> >I have a long xml document which should generate a 100-page pdf document.
> >This document contains mails to various receipiants.
> >Those mails are made of several pages which should be numbered
individually.
> >Does anyone have an idea for numbering properly the whole document?
> I have been struggling with a somehow similar question, and I believe
> the answer must be related.
>
> My question is:
>
> How can one include in the header or footer some non-strictly-static
> information.
>
> In your case, for example, that would mean including the sender and
> recipient of the e-mail in the header of footer. I am assuming that you
> start your e-mails at the beginning of a page, but I don't think this
> affects the whole issue.
>
> I think that the solution must be somehow close to getting different
> {simple|repeatable}-page-master, and using them somehow in the page
> sequence. The actual question is: HOW?




Re: Numbering of pages

Posted by Keiron Liddle <ke...@aftexsw.com>.
Both of these problems sound like they could be done with markers.

On Fri, 2002-07-26 at 08:16, Antonio Fiol Bonnín wrote:
> MARTIN Franck wrote:
> >I have a long xml document which should generate a 100-page pdf document.
> >This document contains mails to various receipiants.
> >Those mails are made of several pages which should be numbered individually.
> >Does anyone have an idea for numbering properly the whole document?
> I have been struggling with a somehow similar question, and I believe 
> the answer must be related.
> 
> My question is:
> 
> How can one include in the header or footer some non-strictly-static 
> information.
> 
> In your case, for example, that would mean including the sender and 
> recipient of the e-mail in the header of footer. I am assuming that you 
> start your e-mails at the beginning of a page, but I don't think this 
> affects the whole issue.
> 
> I think that the solution must be somehow close to getting different 
> {simple|repeatable}-page-master, and using them somehow in the page 
> sequence. The actual question is: HOW?



Re: Numbering of pages

Posted by Antonio Fiol Bonnín <fi...@w3ping.com>.
MARTIN Franck wrote:

>Hi all,
>
>I have a long xml document which should generate a 100-page pdf document.
>This document contains mails to various receipiants.
>Those mails are made of several pages which should be numbered individually.
>Does anyone have an idea for numbering properly the whole document?
>
>Thanks
>
>
>.
>
>  
>
I have been struggling with a somehow similar question, and I believe 
the answer must be related.

My question is:

How can one include in the header or footer some non-strictly-static 
information.

In your case, for example, that would mean including the sender and 
recipient of the e-mail in the header of footer. I am assuming that you 
start your e-mails at the beginning of a page, but I don't think this 
affects the whole issue.

I think that the solution must be somehow close to getting different 
{simple|repeatable}-page-master, and using them somehow in the page 
sequence. The actual question is: HOW?

Yours,


Antonio Fiol


Numbering of pages

Posted by MARTIN Franck <fr...@c-s.fr>.
Hi all,

I have a long xml document which should generate a 100-page pdf document.
This document contains mails to various receipiants.
Those mails are made of several pages which should be numbered individually.
Does anyone have an idea for numbering properly the whole document?

Thanks


Re: page x of y

Posted by "J.Pietschmann" <j3...@yahoo.de>.
sascha wrote:
> Yes, I also saw that but somebody said that would result in any kind of
> problems.

There are no problems beside increased memory consumption.
Which can be *the* problem, of course.

J.Pietschmann


Re: page x of y

Posted by sascha <sa...@assbach.de>.
Yes, I also saw that but somebody said that would result in any kind of
problems.
But i will try it and see if it works with my documents.

Thanks
sascha




----- Original Message -----
From: "Keith Sauvant" <fo...@aspera-ohg.de>
To: <fo...@xml.apache.org>
Sent: Wednesday, July 24, 2002 10:11 AM
Subject: RE: page x of y


> hi sascha,
>
> > when i was looking for a solution on that one in the archive
> > i found a solution from J.Pietschmann with some kind of a function.
>
> i do not know what solution you mean... perhaps this can help you:
>
> to get page x of y you simply have to name an element that will be placed
on
> the last page like that:
>
> <fo:table-cell id="endofdoc">
>
> now you can access its pagenumber everywhere in the document. example:
>
> page <fo:page-number/> of <fo:page-number-citation ref-id="endofdoc"/>
>
> keith
>
>


RE: page x of y

Posted by Keith Sauvant <fo...@aspera-ohg.de>.
hi sascha,

> when i was looking for a solution on that one in the archive
> i found a solution from J.Pietschmann with some kind of a function.

i do not know what solution you mean... perhaps this can help you:

to get page x of y you simply have to name an element that will be placed on
the last page like that:

<fo:table-cell id="endofdoc">

now you can access its pagenumber everywhere in the document. example:

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

keith