PrinterJob printerJob = PrinterJob.getPrinterJob();\r
printerJob.setJobName("FOP Printing Example");\r
\r
- PrintRenderer renderer = new PrintRenderer(printerJob);\r
- \r
try {\r
//Set up a custom user agent so we can supply our own renderer instance\r
FOUserAgent userAgent = fopFactory.newFOUserAgent();\r
+\r
+ //Set up our own PrintRenderer instance so we can supply a special PrinterJob instance.\r
+ PrintRenderer renderer = new PrintRenderer(printerJob);\r
+ renderer.setUserAgent(userAgent);\r
+ \r
userAgent.setRendererOverride(renderer);\r
\r
// Construct fop with desired output format (here, it is set through the user agent)\r