学以致用

focus on Python , C++, and some interest in Go and R

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

在CentOS下使用wkhtmltopdf将html页面转换成pdf的时候对于某些页面可能会出现转换成的pdf中很多字符乱码的情况,更怪异的是直接在命令行下运行一切正常,但在httpd+php下使用却出现乱码,具体解决办法如下:

# install urw-fonts (standard PostScript fonts)
yum install urw-fonts

# install dependencies
yum install fontconfig libXrender libXext xorg-x11-fonts-Type1 xorg-x11-fonts-75dpi freetype libpng zlib libjpeg-turbo openssl

 

see alse:
    http://stackoverflow.com/questions/4627802/squared-characters-issue-on-wkhtmltopdf

posted on 2016-01-22 16:27  Jerry.Kwan  阅读(2546)  评论(0编辑  收藏  举报