导出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
以上是测试环境的操作部署方法,晚上又在生产环境按照这个方法操作OK了。