本文主要是介绍润乾——导出PDF乱码问题,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
客户问题:
客户环境 LINUX系统weblogic10.3.0.0 用weblogic自带 JDK160_05 导出PDF中文字体全是口
解决方法:
客户的说他们的测试服务器和生产服务器环境是一样的,就先在测试环境中搭建了一个DEMO做导出测试,demo中有jsp测试JDK有哪些字体,运行DEMO中的字体jsp发现测试环境没有中文字体,按照下面的方法在LINUX加中文字体
1、拷贝windows下C:\WINDOWS\Fonts\simsun.ttc 文件
2、把字体simsun.ttc复制到../jdk1.4.2/jre/lib/fonts并改名为simsun.ttf
3、修改/home/weblogic/bea/jdk160_05/jre/lib/fonts/fonts.dir。
第一行数字加1;
最后一行加上:
simsun.ttf -SungtiL GB-medium-r-normal--0-0-0-0-c-0-gb2312.1988-0
4、修改/home/weblogic/bea/jdk160_05/jre/lib/fontconfig.properties.src 最下面加下面的内容
# Font File Names
filename.-microsoft-microsoft_jhenghei-medium-r-normal--0-0-0-0-p-0-gb18030.2000-0=/usr/share/fonts/TTF/msjh.ttf
filename.-microsoft-microsoft_jhenghei-bold-r-normal--0-0-0-0-p-0-gb18030.2000-0=/usr/share/fonts/TTF/msjhbd.ttf
filename.-microsoft-meiryo-medium-r-normal--0-0-0-0-p-0-jisx0208.1990-0=/usr/share/fonts/TTF/meiryo.ttc
filename.-microsoft-meiryo-bold-r-normal--0-0-0-0-p-0-jisx0208.1990-0=/usr/share/fonts/TTF/meiryob.ttc
filename.-microsoft-malgun_gothic-medium-r-normal--0-0-0-0-p-0-iso10646-1=/usr/share/fonts/TTF/malgun.ttf
filename.-microsoft-malgun_gothic-bold-r-normal--0-0-0-0-p-0-iso10646-1=/usr/share/fonts/TTF/malgunbd.ttf
filename.-bitstream-bitstream_vera_sans-medium-r-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/Vera.ttf
filename.-bitstream-bitstream_vera_sans-bold-o-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraBI.ttf
filename.-bitstream-bitstream_vera_sans-bold-r-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraBd.ttf
filename.-bitstream-bitstream_vera_sans-medium-o-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraIt.ttf
filename.-bitstream-bitstream_vera_sans_mono-bold-o-normal--0-0-0-0-m-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraMoBI.ttf
filename.-bitstream-bitstream_vera_sans_mono-bold-r-normal--0-0-0-0-m-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraMoBd.ttf
filename.-bitstream-bitstream_vera_sans_mono-medium-o-normal--0-0-0-0-m-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraMoIt.ttf
filename.-bitstream-bitstream_vera_sans_mono-medium-r-normal--0-0-0-0-m-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraMono.ttf
filename.-bitstream-bitstream_vera_serif-medium-r-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraSe.ttf
filename.-bitstream-bitstream_vera_serif-bold-r-normal--0-0-0-0-p-0-iso8859-1=/usr/share/fonts/ttf-bitstream-vera/VeraSeBd.ttf
# AWT X11 font paths
awtfontpath.latin-1=/usr/share/fonts/ttf-bitstream-vera
awtfontpath.chinese-big5=/usr/share/fonts/TTF
awtfontpath.chinese-gb18030=/usr/share/fonts/TTF
awtfontpath.japanese-x0208=/usr/share/fonts/TTF
awtfontpath.korean=/usr/share/fonts/TTF
备注:
不同版本的JDK路径会不一样修改的文件也会不一样,这个是JDK1.6版本的方法。
这篇关于润乾——导出PDF乱码问题的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!