*/
public void printFO(File fo)
throws IOException, FOPException, TransformerException, PrintException {
//Set up DocPrintJob instance
DocPrintJob printJob = createDocPrintJob();
//Set up a custom user agent so we can supply our own renderer instance
FOUserAgent userAgent = fopFactory.newFOUserAgent();
PageableRenderer renderer = new PageableRenderer(userAgent);
userAgent.setRendererOverride(renderer);
// Construct FOP with desired output format
Fop fop = fopFactory.newFop(userAgent);
// Setup JAXP using identity transformer
TransformerFactory factory = TransformerFactory.newInstance();
Transformer transformer = factory.newTransformer(); // identity transformer
// Setup input stream
Source src = new StreamSource(fo);
// Resulting SAX events (the generated FO) must be piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
// Start XSLT transformation and FOP processing
transformer.transform(src, res);
Doc doc = new SimpleDoc(renderer, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null);
printJob.print(doc, null);
}