get page count from fo file

Here should go questions about transforming XML with XSLT and FOP.
christophnagl
Posts: 4
Joined: Tue Jun 07, 2005 2:17 pm

get page count from fo file

Post by christophnagl »

Hi,

Is there a possibility to get page count without generate a pdf file?

I have a xsl file with defined height. Then I generate the pdf file and check the page count. If greater than 1 I change the height of the xsl file in memory and now generate the pdf file again.

then i generate from the fo file with the user writtn renderer a specific file. is there a possibility to get the page count from the fo file? then i spare me on generation step with the pdf or is there maybe one other solution that i can force the generation process only to make 1 page.

thanks for the help.

christoph
sorin_ristache
Posts: 4141
Joined: Fri Mar 28, 2003 2:12 pm

Post by sorin_ristache »

Hello,

You can only get page numbers. There is no FO processor independent way to get the total number of pages. You should check if your FO processor offers an extension for that. There is a possibility to get the total number of pages using Apache FOP at the Java application level without writing the PDF file on disk but you did not specify if you just apply an XSL-FO processor from an XML/XSLT IDE or you use the Java API of your FO processor (if it is a Java library).


Regards,
Sorin
Post Reply