Page 1 of 1

get page count from fo file

Posted: Thu Jul 13, 2006 3:57 pm
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

Posted: Thu Jul 13, 2006 5:13 pm
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