diff options
Diffstat (limited to 'src/java/org/apache/fop/cli/InputHandler.java')
-rw-r--r-- | src/java/org/apache/fop/cli/InputHandler.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/cli/InputHandler.java b/src/java/org/apache/fop/cli/InputHandler.java index 554f5d572..13d756ada 100644 --- a/src/java/org/apache/fop/cli/InputHandler.java +++ b/src/java/org/apache/fop/cli/InputHandler.java @@ -39,6 +39,7 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.Fop; +import org.apache.fop.apps.FopFactory; import org.apache.fop.render.awt.viewer.Renderable; /** @@ -85,10 +86,13 @@ public class InputHandler implements ErrorListener, Renderable { */ public void renderTo(FOUserAgent userAgent, String outputFormat, OutputStream out) throws FOPException { - - Fop fop = new Fop(outputFormat, userAgent); + + FopFactory factory = userAgent.getFactory(); + Fop fop; if (out != null) { - fop.setOutputStream(out); + fop = factory.newFop(outputFormat, userAgent, out); + } else { + fop = factory.newFop(outputFormat, userAgent); } // if base URL was not explicitly set in FOUserAgent, obtain here |