From 35bce6e9b424663bddca283dcea9d72f6bbec0f7 Mon Sep 17 00:00:00 2001 From: Jeremias Maerki Date: Mon, 23 Feb 2009 13:38:48 +0000 Subject: Tied RendererFactory.setRendererPreferred(boolean) setting into the FOP configuration (incl. documentation). git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@747015 13f79535-47bb-0310-9956-ffa450edef68 --- src/documentation/content/xdocs/trunk/configuration.xml | 12 ++++++++++++ src/java/org/apache/fop/apps/FopFactoryConfigurator.java | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/src/documentation/content/xdocs/trunk/configuration.xml b/src/documentation/content/xdocs/trunk/configuration.xml index 08463b9b9..7fc0d97d9 100644 --- a/src/documentation/content/xdocs/trunk/configuration.xml +++ b/src/documentation/content/xdocs/trunk/configuration.xml @@ -151,6 +151,18 @@ default-page-settings element to specify the two values. "height" 11 inches, "width" 8.26 inches + + prefer-renderer + boolean (true, false) + + By default, FOP prefers the newer output implementations based on the + IFDocumentHandler interface. If no such implementation can be found for + a given MIME type, it looks for an implementation of the Renderer interface. + If necessary, you can invert the lookup order to prefer the Renderer variant over the + IFDocumentHandler variant by setting this value to true. + + false + use-cache boolean (true, false) diff --git a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java index e71173845..2beb5373c 100644 --- a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java +++ b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java @@ -61,6 +61,8 @@ public class FopFactoryConfigurator { /** Defines the default target resolution (72dpi) for FOP */ public static final float DEFAULT_TARGET_RESOLUTION = 72.0f; //dpi + private static final String PREFER_RENDERER = "prefer-renderer"; + /** logger instance */ private final Log log = LogFactory.getLog(FopFactoryConfigurator.class); @@ -173,6 +175,16 @@ public class FopFactoryConfigurator { } } + // prefer Renderer over IFDocumentHandler + if (cfg.getChild(PREFER_RENDERER, false) != null) { + try { + factory.getRendererFactory().setRendererPreferred( + cfg.getChild(PREFER_RENDERER).getValueAsBoolean()); + } catch (ConfigurationException e) { + LogUtil.handleException(log, e, strict); + } + } + // configure font manager FontManager fontManager = factory.getFontManager(); FontManagerConfigurator fontManagerConfigurator = new FontManagerConfigurator(cfg); -- cgit v1.2.3