svn commit: r495969 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r495969 - /ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java

jleroux@apache.org
Author: jleroux
Date: Sat Jan 13 13:05:57 2007
New Revision: 495969

URL: http://svn.apache.org/viewvc?view=rev&rev=495969
Log:
A patch from Christian Geisert for "Incorrect rendering of international characters in PDF reports created using XSL:FO" (https://issues.apache.org/jira/browse/OFBIZ-170)

Modified:
    ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java

Modified: ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java?view=diff&rev=495969&r1=495968&r2=495969
==============================================================================
--- ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java (original)
+++ ofbiz/trunk/framework/webapp/src/org/ofbiz/webapp/view/ApacheFopFactory.java Sat Jan 13 13:05:57 2007
@@ -16,6 +16,10 @@
 package org.ofbiz.webapp.view;
 
 import org.apache.fop.apps.FopFactory;
+import org.ofbiz.base.util.Debug;
+import org.ofbiz.base.util.UtilProperties;
+
+import java.io.File;
 
 /**
  * Apache FOP Factory used to provide a singleton instance of the FopFactory.  Best pratices recommended
@@ -25,6 +29,8 @@
 
 public class ApacheFopFactory {
 
+    public static final String module = ApacheFopFactory.class.getName();
+    
     private static final FopFactory fopFactory;
 
     static {
@@ -33,6 +39,19 @@
 
         // Limit the validation for backwards compatibility
         fopFactory.setStrictValidation(false);
+        
+        try {
+            String fopPath = UtilProperties.getPropertyValue("fop.properties", "fop.path","framework/widget/config");
+            File userConfigFile = new File(fopPath + "/fop.xconf");
+            fopFactory.setUserConfig(userConfigFile);
+            String ofbizHome = System.getProperty("ofbiz.home");
+            String fopFontBaseUrl = UtilProperties.getPropertyValue("fop.properties", "fop.font.base.url",
+                                    "file://" + ofbizHome + "/framework/widget/config/");
+            Debug.log("FOP-FontBaseURL: " + fopFontBaseUrl, module);
+            fopFactory.setFontBaseURL(fopFontBaseUrl);
+        } catch (Exception e) {
+            Debug.logWarning("Error reading FOP configuration", module);
+        }
     }
 
     public static FopFactory instance() {