pdfname = foname.substring(0, p) + ".pdf";
File pdffile = new File(outDir, pdfname);
// transform and render
System.out.print("Transforming " + fofile + " to PDF file " + pdffile + "...");
FormattingResults foResults = convertFO2PDF(fofile, pdffile);
System.out.println("done!");
// Result processing
java.util.List pageSequences = foResults.getPageSequences();
for (java.util.Iterator it = pageSequences.iterator(); it.hasNext();) {
PageSequenceResults pageSequenceResults = (PageSequenceResults)it.next();
System.out.println("PageSequence "
+ (String.valueOf(pageSequenceResults.getID()).length() > 0
? pageSequenceResults.getID() : "<no id>")
+ " generated " + pageSequenceResults.getPageCount() + " pages.");
}
System.out.println("Generated " + foResults.getPageCount() + " pages in total.");
} catch (Exception e) {
System.out.println("failure!");
e.printStackTrace(System.out);
} finally {