aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/area/RenderPagesModel.java
diff options
context:
space:
mode:
authorSimon Pepping <spepping@apache.org>2004-07-09 17:27:12 +0000
committerSimon Pepping <spepping@apache.org>2004-07-09 17:27:12 +0000
commitd04908a05ef64a2850289f6817125bd8a02c9088 (patch)
treed061c12afadde065aacd2f067490e7af033b6bc9 /src/java/org/apache/fop/area/RenderPagesModel.java
parentf7ebe087cfc59cf9ff28e7f458e2e4f21f9770e9 (diff)
downloadxmlgraphics-fop-d04908a05ef64a2850289f6817125bd8a02c9088.tar.gz
xmlgraphics-fop-d04908a05ef64a2850289f6817125bd8a02c9088.zip
Implementing user configuration file.
Adding debug logging for user configuration, user PDF filters and user fonts. Adding reporting of mime type to renderers. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197774 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/area/RenderPagesModel.java')
-rw-r--r--src/java/org/apache/fop/area/RenderPagesModel.java29
1 files changed, 24 insertions, 5 deletions
diff --git a/src/java/org/apache/fop/area/RenderPagesModel.java b/src/java/org/apache/fop/area/RenderPagesModel.java
index 96fcb8a7e..fd62a88d9 100644
--- a/src/java/org/apache/fop/area/RenderPagesModel.java
+++ b/src/java/org/apache/fop/area/RenderPagesModel.java
@@ -27,12 +27,17 @@ import java.util.Iterator;
// XML
import org.xml.sax.SAXException;
+// avalon configuration
+import org.apache.avalon.framework.configuration.Configuration;
+import org.apache.avalon.framework.configuration.ConfigurationException;
+
// FOP
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.Constants;
import org.apache.fop.fonts.FontInfo;
import org.apache.fop.render.Renderer;
+import org.apache.fop.render.AbstractRenderer;
/**
* This uses the store pages model to store the pages
@@ -69,8 +74,22 @@ public class RenderPagesModel extends StorePagesModel {
if (userAgent.getRendererOverride() != null) {
renderer = userAgent.getRendererOverride();
} else {
- renderer = createRenderer(renderType);
- renderer.setUserAgent(userAgent);
+ AbstractRenderer rend = createRenderer(renderType);
+ rend.setUserAgent(userAgent);
+ String mimeType = rend.getMimeType();
+ Configuration userRendererConfig = null;
+ if (mimeType != null) {
+ userRendererConfig
+ = userAgent.getUserRendererConfig(mimeType);
+ }
+ if (userRendererConfig != null) {
+ try {
+ rend.configure(userRendererConfig);
+ } catch (ConfigurationException e) {
+ throw new FOPException(e);
+ }
+ }
+ renderer = rend;
}
try {
@@ -87,12 +106,12 @@ public class RenderPagesModel extends StorePagesModel {
}
/**
- * Creates a Renderer object based on render-type desired
+ * Creates an AbstractRenderer object based on render-type desired
* @param renderType the type of renderer to use
- * @return Renderer the new Renderer instance
+ * @return AbstractRenderer the new Renderer instance
* @throws IllegalArgumentException if an unsupported renderer type was requested
*/
- private Renderer createRenderer(int renderType) throws IllegalArgumentException {
+ private AbstractRenderer createRenderer(int renderType) throws IllegalArgumentException {
switch (renderType) {
case Constants.RENDER_PDF: