On Fri, 2003-01-31 at 13:51, MARTIN Franck wrote:
> Is there any way to count the number of pages for a pdf generated file?
Maybe the following code can help:
File userConfigFile = new File("lib/userconfig.xml");
options = new Options(userConfigFile);
output = new FileOutputStream(outputFile);
driver = new Driver(new InputSource(temporary), output);
driver.setRenderer(Driver.RENDER_PDF);
try {
driver.run();
FormattingResults result = driver.getResults();
screenLog.append("Result:" + result.getPageCount() + " pages
rendered.");
result = null;
output.close();
} catch (IOException el) {
screenLog.append(el.getLocalizedMessage());
} catch (FOPException el) {
screenLog.append(el.getLocalizedMessage());
}
You have to add try/catch blocks and define your own variables.
Rodolfo
--
Rodolfo M. Raya <[EMAIL PROTECTED]>
Heartsome Holdings Pte. Ltd.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]