aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2009-02-23 13:38:48 +0000
committerJeremias Maerki <jeremias@apache.org>2009-02-23 13:38:48 +0000
commit35bce6e9b424663bddca283dcea9d72f6bbec0f7 (patch)
tree963afd9dbf2e9e6cb67479e31a917e1f3b852f2f
parent96d9ae1c7cf3b0831dda48869f1414328ed6d875 (diff)
downloadxmlgraphics-fop-35bce6e9b424663bddca283dcea9d72f6bbec0f7.tar.gz
xmlgraphics-fop-35bce6e9b424663bddca283dcea9d72f6bbec0f7.zip
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
-rw-r--r--src/documentation/content/xdocs/trunk/configuration.xml12
-rw-r--r--src/java/org/apache/fop/apps/FopFactoryConfigurator.java12
2 files changed, 24 insertions, 0 deletions
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
@@ -152,6 +152,18 @@
<td>"height" 11 inches, "width" 8.26 inches</td>
</tr>
<tr>
+ <td>prefer-renderer</td>
+ <td>boolean (true, false)</td>
+ <td>
+ By default, FOP prefers the newer output implementations based on the
+ <code>IFDocumentHandler</code> interface. If no such implementation can be found for
+ a given MIME type, it looks for an implementation of the <code>Renderer</code> interface.
+ If necessary, you can invert the lookup order to prefer the Renderer variant over the
+ IFDocumentHandler variant by setting this value to true.
+ </td>
+ <td>false</td>
+ </tr>
+ <tr>
<td>use-cache</td>
<td>boolean (true, false)</td>
<td>All fonts information that has been gathered as a result of "directory"
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);