ofbiz pdf导出中文显示井号

1、导入simhei.ttf、simhei.xml两个文件到framework/webapp/config/下(可以这里下到:http://jeho0815.iteye.com/blog/1187197 或者是自己通过fop生成)

2、修改fop.xconf(framework/webapp/config/fop.xconf ),添加下面四行,对SimHei字体定义

<renderer mime="application/pdf">
  .....
  <fonts>
  ...
   <font metrics-url="simhei.xml" kerning="yes" embed-url="simhei.ttf"> <font-triplet name="SimHei" style="normal" weight="normal"/> <font-triplet name="SimHei" style="normal" weight="bold"/> </font>
  </fonts>

3、修改CommonScreens.xml ,patch文件如下:

@@ -373,8 +374,9 @@ 
                 <set field="layoutSettings.shortcutIcon" value="/images/ofbiz.ico" global="true"/> 
                 <!-- The settings below are used for xsl-fo screens --> 
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> 
                 <set field="logoImageUrl" value="/images/ofbiz_logo.gif"/> 
-                <!--<set field="defaultFontFamily" value="Arial"/>--> 
+                <set field="defaultFontFamily" value="SimHei"/> 
             </actions> 
             <widgets> 
                 <!-- render header --> 
@@ -392,8 +394,9 @@ 
         <section> 
             <actions> 
                 <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/> 
                 <set field="logoImageUrl" value="/images/ofbiz_logo.gif"/> 
-                <!--<set field="defaultFontFamily" value="Arial"/>--> 
+                <set field="defaultFontFamily" value="SimHei"/> 
            </actions> 
             <widgets> 
                 <platform-specific><xsl-fo><html-template location="component://common/webcommon/includes/reportTemplate.fo.ftl"/></xsl-fo></platform-specific> 

此时重启ofbiz,重新导入看看

参考网址:http://ofbiz.135035.n4.nabble.com/Multi-lingual-suport-for-FOP-in-OFBIZ-9-04-td1934541.html

     http://jeho0815.iteye.com/blog/1187197

posted @ 2014-10-27 20:20  tutar  阅读(847)  评论(0)    收藏  举报