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 Matthias Müller <py...@yahoo.de> on 2010/08/25 14:37:54 UTC

Indicate Last Page

Hi there,

i need to indicate the single pages on my output pdf in the footer area:
  - if there are following pages with a "+"
  - if it's the last page with a "-"

i already posted a similar question 2 years ago and didn't receive a working 
hint. back then i worked with FOP 0.20.5, so maybe something has changed 
meanwhile. here is the most useful answer:

"Is this possible?

No, for various reasons. The most important one is that the
processing is done in two passes.
The first pass is the XSL transformation. The elements prefixed
with xsl: are instructions for the XSLT processor, which
generates an intermediate XML document consisting of elements
in the FO namespace, commonly prefixed with fo:. The FO elements
are not processed by the XSLT processor, therefore FO stuff like
page numbers are not available to the XSLT processor. In
particular there is no way to check whether something is on the
last page during XSLT processing.
The second pass is the formatting, done by formatting processors
like FOP. At this point, all xsl: elements are already gone,
there is no xsl:if available to the FO processor.

There are some possibilities in the XSLFO standard to define
limited special processing for the last rendered page of a page
sequence, unfortunately, they are not yet implemented in FOP."

maybe with FOP 1.0?
any hints welcome ;-)




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: Indicate Last Page

Posted by Matthias Müller <py...@yahoo.de>.
wow, that's exactly what i needed ;-)
never heard of markers before

thanks a lot



----- Ursprüngliche Mail ----
Von: Vincent Hennebert <vh...@gmail.com>
An: fop-users@xmlgraphics.apache.org
Gesendet: Donnerstag, den 26. August 2010, 18:45:43 Uhr
Betreff: Re: Indicate Last Page

Hi Matthias,

Sounds like a job for markers. Does the attached FO file help?

Vincent


Matthias Müller wrote:
> Hi there,
> 
> i need to indicate the single pages on my output pdf in the footer area:
>   - if there are following pages with a "+"
>   - if it's the last page with a "-"
> 
> i already posted a similar question 2 years ago and didn't receive a working 
> hint. back then i worked with FOP 0.20.5, so maybe something has changed 
> meanwhile. here is the most useful answer:
> 
> "Is this possible?
> 
> No, for various reasons. The most important one is that the
> processing is done in two passes.
> The first pass is the XSL transformation. The elements prefixed
> with xsl: are instructions for the XSLT processor, which
> generates an intermediate XML document consisting of elements
> in the FO namespace, commonly prefixed with fo:. The FO elements
> are not processed by the XSLT processor, therefore FO stuff like
> page numbers are not available to the XSLT processor. In
> particular there is no way to check whether something is on the
> last page during XSLT processing.
> The second pass is the formatting, done by formatting processors
> like FOP. At this point, all xsl: elements are already gone,
> there is no xsl:if available to the FO processor.
> 
> There are some possibilities in the XSLFO standard to define
> limited special processing for the last rendered page of a page
> sequence, unfortunately, they are not yet implemented in FOP."
> 
> maybe with FOP 1.0?
> any hints welcome ;-)

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Re: Indicate Last Page

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi Matthias,

Sounds like a job for markers. Does the attached FO file help?

Vincent


Matthias Müller wrote:
> Hi there,
> 
> i need to indicate the single pages on my output pdf in the footer area:
>   - if there are following pages with a "+"
>   - if it's the last page with a "-"
> 
> i already posted a similar question 2 years ago and didn't receive a working 
> hint. back then i worked with FOP 0.20.5, so maybe something has changed 
> meanwhile. here is the most useful answer:
> 
> "Is this possible?
> 
> No, for various reasons. The most important one is that the
> processing is done in two passes.
> The first pass is the XSL transformation. The elements prefixed
> with xsl: are instructions for the XSLT processor, which
> generates an intermediate XML document consisting of elements
> in the FO namespace, commonly prefixed with fo:. The FO elements
> are not processed by the XSLT processor, therefore FO stuff like
> page numbers are not available to the XSLT processor. In
> particular there is no way to check whether something is on the
> last page during XSLT processing.
> The second pass is the formatting, done by formatting processors
> like FOP. At this point, all xsl: elements are already gone,
> there is no xsl:if available to the FO processor.
> 
> There are some possibilities in the XSLFO standard to define
> limited special processing for the last rendered page of a page
> sequence, unfortunately, they are not yet implemented in FOP."
> 
> maybe with FOP 1.0?
> any hints welcome ;-)

RE: Indicate Last Page

Posted by Stuart Scott <St...@countrywide.co.uk>.
Hi Matthias

Have you looked at Conditional Pages?

   <page-sequence-master master-name="whatever"> 
     <repeatable-page-master-alternatives maximum-repeats="1"> 
       <conditional-page-master-reference master-reference="only-page-layout" 
                                          page-position="last"/> 
       <conditional-page-master-reference master-reference="first-page-layout" 
                                          page-position="first"/> 
     </repeatable-page-master-alternatives> 
     <repeatable-page-master-alternatives maximum-repeats="no-limit"> 
       <conditional-page-master-reference master-reference="last-page-layout" 
                                          page-position="last"/> 
       <conditional-page-master-reference master-reference="rest-page-layout" 
                                          page-position="rest"/> 
     </repeatable-page-master-alternatives> 
   </page-sequence-master>

Kind regards
 
Stuart Scott 

-----Original Message-----
From: Matthias Müller [mailto:pymote@yahoo.de] 
Sent: 26 August 2010 08:31
To: fop-users@xmlgraphics.apache.org
Subject: AW: Indicate Last Page

i already display "page X of Y" at the page bottom. what i need is a special fo 
processing for the last page.



----- Ursprüngliche Mail ----
Von: Eric Douglas <ed...@blockhouse.com>
An: fop-users@xmlgraphics.apache.org
Gesendet: Mittwoch, den 25. August 2010, 17:03:18 Uhr
Betreff: RE: Indicate Last Page

You can get the number of the last page by ending your fo:flow section with 
this:
<fo:block>
         <xsl:attribute name="id">last-page</xsl:attribute>
Then you can print the last page number inline in your text area with this:
<fo:page-number-citation ref-id="last-page"/>

All I do is print it but I would guess you could use that logic to print 
something based on that?
For comparison, <fo:page-number /> gives you the current page number.
I'm not sure how you're trying to print the footer values, if you can use the fo 
tag at that point.


-----Original Message-----
From: Matthias Müller [mailto:pymote@yahoo.de] 
Sent: Wednesday, August 25, 2010 8:38 AM
To: fop-users xmlgraphics
Subject: Indicate Last Page

Hi there,

i need to indicate the single pages on my output pdf in the footer area:
  - if there are following pages with a "+"
  - if it's the last page with a "-"

i already posted a similar question 2 years ago and didn't receive a working 
hint. back then i worked with FOP 0.20.5, so maybe something has changed 
meanwhile. here is the most useful answer:

"Is this possible?

No, for various reasons. The most important one is that the processing is done 
in two passes.
The first pass is the XSL transformation. The elements prefixed with xsl: are 
instructions for the XSLT processor, which generates an intermediate XML 
document consisting of elements in the FO namespace, commonly prefixed with fo:. 
The FO elements are not processed by the XSLT processor, therefore FO stuff like 
page numbers are not available to the XSLT processor. In particular there is no 
way to check whether something is on the last page during XSLT processing.
The second pass is the formatting, done by formatting processors like FOP. At 
this point, all xsl: elements are already gone, there is no xsl:if available to 
the FO processor.

There are some possibilities in the XSLFO standard to define limited special 
processing for the last rendered page of a page sequence, unfortunately, they 
are not yet implemented in FOP."

maybe with FOP 1.0?
any hints welcome ;-)




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


For email disclaimer details please click or visit - http://www.countrywideplc.co.uk/disclaimer

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Indicate Last Page

Posted by Eric Douglas <ed...@blockhouse.com>.
As I said, "I'm not sure how you're trying to print the footer values".
Is this part of your flow?  Static content?  Maybe you can provide a snippet of your XSL where you need this and I could help you correct it?

I don't know how you're using FOP or how much flexibility you have with your application.  It may be easier in my case.  I am using embedded code.  I am generating my XML input with a program which calculates what fits on a page and where and passes in a value for the XSL to place text to absolute positioning, so I can have a header and footer area but it's all done in that program which generates the XML so I'm not using the XSL tags for header, footer, or static content.  Everything is in the flow in the body.  I'd have to test it, but my guess is if there's an fo tag which prints a value for the last page number, you should be able to get that value into an xsl variable for conditional processing if you're printing in the flow.
 

-----Original Message-----
From: Matthias Müller [mailto:pymote@yahoo.de] 
Sent: Thursday, August 26, 2010 3:31 AM
To: fop-users@xmlgraphics.apache.org
Subject: AW: Indicate Last Page

i already display "page X of Y" at the page bottom. what i need is a special fo processing for the last page.



----- Ursprüngliche Mail ----
Von: Eric Douglas <ed...@blockhouse.com>
An: fop-users@xmlgraphics.apache.org
Gesendet: Mittwoch, den 25. August 2010, 17:03:18 Uhr
Betreff: RE: Indicate Last Page

You can get the number of the last page by ending your fo:flow section with 
this:
<fo:block>
         <xsl:attribute name="id">last-page</xsl:attribute>
Then you can print the last page number inline in your text area with this:
<fo:page-number-citation ref-id="last-page"/>

All I do is print it but I would guess you could use that logic to print 
something based on that?
For comparison, <fo:page-number /> gives you the current page number.
I'm not sure how you're trying to print the footer values, if you can use the fo 
tag at that point.


-----Original Message-----
From: Matthias Müller [mailto:pymote@yahoo.de] 
Sent: Wednesday, August 25, 2010 8:38 AM
To: fop-users xmlgraphics
Subject: Indicate Last Page

Hi there,

i need to indicate the single pages on my output pdf in the footer area:
  - if there are following pages with a "+"
  - if it's the last page with a "-"

i already posted a similar question 2 years ago and didn't receive a working 
hint. back then i worked with FOP 0.20.5, so maybe something has changed 
meanwhile. here is the most useful answer:

"Is this possible?

No, for various reasons. The most important one is that the processing is done 
in two passes.
The first pass is the XSL transformation. The elements prefixed with xsl: are 
instructions for the XSLT processor, which generates an intermediate XML 
document consisting of elements in the FO namespace, commonly prefixed with fo:. 
The FO elements are not processed by the XSLT processor, therefore FO stuff like 
page numbers are not available to the XSLT processor. In particular there is no 
way to check whether something is on the last page during XSLT processing.
The second pass is the formatting, done by formatting processors like FOP. At 
this point, all xsl: elements are already gone, there is no xsl:if available to 
the FO processor.

There are some possibilities in the XSLFO standard to define limited special 
processing for the last rendered page of a page sequence, unfortunately, they 
are not yet implemented in FOP."

maybe with FOP 1.0?
any hints welcome ;-)




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


AW: Indicate Last Page

Posted by Matthias Müller <py...@yahoo.de>.
i already display "page X of Y" at the page bottom. what i need is a special fo 
processing for the last page.



----- Ursprüngliche Mail ----
Von: Eric Douglas <ed...@blockhouse.com>
An: fop-users@xmlgraphics.apache.org
Gesendet: Mittwoch, den 25. August 2010, 17:03:18 Uhr
Betreff: RE: Indicate Last Page

You can get the number of the last page by ending your fo:flow section with 
this:
<fo:block>
         <xsl:attribute name="id">last-page</xsl:attribute>
Then you can print the last page number inline in your text area with this:
<fo:page-number-citation ref-id="last-page"/>

All I do is print it but I would guess you could use that logic to print 
something based on that?
For comparison, <fo:page-number /> gives you the current page number.
I'm not sure how you're trying to print the footer values, if you can use the fo 
tag at that point.


-----Original Message-----
From: Matthias Müller [mailto:pymote@yahoo.de] 
Sent: Wednesday, August 25, 2010 8:38 AM
To: fop-users xmlgraphics
Subject: Indicate Last Page

Hi there,

i need to indicate the single pages on my output pdf in the footer area:
  - if there are following pages with a "+"
  - if it's the last page with a "-"

i already posted a similar question 2 years ago and didn't receive a working 
hint. back then i worked with FOP 0.20.5, so maybe something has changed 
meanwhile. here is the most useful answer:

"Is this possible?

No, for various reasons. The most important one is that the processing is done 
in two passes.
The first pass is the XSL transformation. The elements prefixed with xsl: are 
instructions for the XSLT processor, which generates an intermediate XML 
document consisting of elements in the FO namespace, commonly prefixed with fo:. 
The FO elements are not processed by the XSLT processor, therefore FO stuff like 
page numbers are not available to the XSLT processor. In particular there is no 
way to check whether something is on the last page during XSLT processing.
The second pass is the formatting, done by formatting processors like FOP. At 
this point, all xsl: elements are already gone, there is no xsl:if available to 
the FO processor.

There are some possibilities in the XSLFO standard to define limited special 
processing for the last rendered page of a page sequence, unfortunately, they 
are not yet implemented in FOP."

maybe with FOP 1.0?
any hints welcome ;-)




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


RE: Indicate Last Page

Posted by Eric Douglas <ed...@blockhouse.com>.
You can get the number of the last page by ending your fo:flow section with this:
<fo:block>
         <xsl:attribute name="id">last-page</xsl:attribute>
Then you can print the last page number inline in your text area with this:
<fo:page-number-citation ref-id="last-page"/>

All I do is print it but I would guess you could use that logic to print something based on that?
For comparison, <fo:page-number /> gives you the current page number.
I'm not sure how you're trying to print the footer values, if you can use the fo tag at that point.


-----Original Message-----
From: Matthias Müller [mailto:pymote@yahoo.de] 
Sent: Wednesday, August 25, 2010 8:38 AM
To: fop-users xmlgraphics
Subject: Indicate Last Page

Hi there,

i need to indicate the single pages on my output pdf in the footer area:
  - if there are following pages with a "+"
  - if it's the last page with a "-"

i already posted a similar question 2 years ago and didn't receive a working hint. back then i worked with FOP 0.20.5, so maybe something has changed meanwhile. here is the most useful answer:

"Is this possible?

No, for various reasons. The most important one is that the processing is done in two passes.
The first pass is the XSL transformation. The elements prefixed with xsl: are instructions for the XSLT processor, which generates an intermediate XML document consisting of elements in the FO namespace, commonly prefixed with fo:. The FO elements are not processed by the XSLT processor, therefore FO stuff like page numbers are not available to the XSLT processor. In particular there is no way to check whether something is on the last page during XSLT processing.
The second pass is the formatting, done by formatting processors like FOP. At this point, all xsl: elements are already gone, there is no xsl:if available to the FO processor.

There are some possibilities in the XSLFO standard to define limited special processing for the last rendered page of a page sequence, unfortunately, they are not yet implemented in FOP."

maybe with FOP 1.0?
any hints welcome ;-)




---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org