diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-09-10 11:38:03 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-09-10 11:38:03 +0000 |
commit | 4bc66553af06005331b55f3ecd108f307b82cd30 (patch) | |
tree | 24e785b1027e6198327f38fcb3258d4c552e29cb /examples/embedding | |
parent | 9804c472d9df8a60256b7933461ee78e463027cb (diff) | |
download | xmlgraphics-fop-4bc66553af06005331b55f3ecd108f307b82cd30.tar.gz xmlgraphics-fop-4bc66553af06005331b55f3ecd108f307b82cd30.zip |
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
Diffstat (limited to 'examples/embedding')
-rw-r--r-- | examples/embedding/java/embedding/ExampleFO2OldStylePrint.java | 7 |
1 files 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)
|