From 4bc66553af06005331b55f3ecd108f307b82cd30 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Sun, 10 Sep 2006 11:38:03 +0000 Subject: [PATCH] Fix a bug in the example code: Without setting the user agent on the Renderer instance, stuff like using images doesn't work. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@441942 13f79535-47bb-0310-9956-ffa450edef68 --- .../embedding/java/embedding/ExampleFO2OldStylePrint.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java b/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java index a9519e35d..8d8ecd465 100644 --- a/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java +++ b/examples/embedding/java/embedding/ExampleFO2OldStylePrint.java @@ -60,11 +60,14 @@ public class ExampleFO2OldStylePrint { PrinterJob printerJob = PrinterJob.getPrinterJob(); printerJob.setJobName("FOP Printing Example"); - PrintRenderer renderer = new PrintRenderer(printerJob); - try { //Set up a custom user agent so we can supply our own renderer instance FOUserAgent userAgent = fopFactory.newFOUserAgent(); + + //Set up our own PrintRenderer instance so we can supply a special PrinterJob instance. + PrintRenderer renderer = new PrintRenderer(printerJob); + renderer.setUserAgent(userAgent); + userAgent.setRendererOverride(renderer); // Construct fop with desired output format (here, it is set through the user agent) -- 2.39.5