]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Fix a bug in the example code: Without setting the user agent on the Renderer instanc...
authorJeremias Maerki <jeremias@apache.org>
Sun, 10 Sep 2006 11:38:03 +0000 (11:38 +0000)
committerJeremias Maerki <jeremias@apache.org>
Sun, 10 Sep 2006 11:38:03 +0000 (11:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@441942 13f79535-47bb-0310-9956-ffa450edef68

examples/embedding/java/embedding/ExampleFO2OldStylePrint.java

index a9519e35daaa2dbcd83155856531116f0b34dc0b..8d8ecd4656f7a9e40d8231dff23c52909cf160db 100644 (file)
@@ -60,11 +60,14 @@ public class ExampleFO2OldStylePrint {
         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