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 "M. Grauel" <gr...@adesso.de> on 2008/05/05 14:05:57 UTC

RTF generation and total page count

Hello,

I am using fop to generate RTFs. I have managed to get around most of the
limitations. But know I need some help.

I need to print out the total page count, like "page 4 of 9". The current page
number (in my example the 4) is no problem. But I can't find a way to generate
the total page count.

I've tried to reference an element on the last page without success. I've also
tried the two-pass-way, mentioned in the faqs. Sadly the RTF renderer is not
capable of telling me how many pages it has generated.

In Word I can input the page count. Does RTFlib support this control-command
(and therefore enable me to implement this functionality)?

I am out of ideas and would greatly appreciate any help!

Thank you

M. Grauel


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


Re: RTF generation and total page count

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
There seems to be some support for page number citations in the RTF
library but it is not wired into the RTFHandler. You can try to
implement it yourself and send a patch.

What you probably have to do:
- Override
public void startPageNumberCitation(PageNumberCitation pageCite)
and
public void endPageNumberCitation(PageNumberCitation pageCite)
in RTFHandler.java (take startPageNumber() as a template)
- There's a newPageNumberCitation() method in RtfParagraph.
- You will also need to add the anchors for the IDs somehow. Not sure
how and where to do that.

Good luck!


On 05.05.2008 14:05:57 M. Grauel wrote:
> Hello,
> 
> I am using fop to generate RTFs. I have managed to get around most of the
> limitations. But know I need some help.
> 
> I need to print out the total page count, like "page 4 of 9". The current page
> number (in my example the 4) is no problem. But I can't find a way to generate
> the total page count.
> 
> I've tried to reference an element on the last page without success. I've also
> tried the two-pass-way, mentioned in the faqs. Sadly the RTF renderer is not
> capable of telling me how many pages it has generated.
> 
> In Word I can input the page count. Does RTFlib support this control-command
> (and therefore enable me to implement this functionality)?
> 
> I am out of ideas and would greatly appreciate any help!
> 
> Thank you
> 
> M. Grauel



Jeremias Maerki


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