下载安装
wget ftp://ftp.imagemagick.org/pub/ImageMagick/ImageMagick.tar.gz
wget http://downloads.ghostscript.com/public/ghostscript-9.02.tar.gz
yum install libpng-devel
yum install libjpeg
yum install gd-devel
tar -zxvf ghostscript-9.02.tar.gz
cd ghostscript-9.02
./configure
vi Makefile
找到"COMPILE_INITS=1"这一行, 把它修改为0
make
make install
tar -zxvf ImageMagick.tar.gz
cd ImageMagick-6.6.8-5
./configure
make
make install
配置
从windows中复制中文字体文件simsun.ttf 到linux下/usr/local/share/ghostscript/9.02/Resource/Font
echo "">/usr/local/share/ghostscript/9.02/Resource/Init/cidfmap
vi /usr/local/share/ghostscript/9.02/Resource/Init/cidfmap
%!
% cidfmap generated automatically by mkcidfm.ps from fonts found in
% /usr/local/share/ghostscript/9.02/Resource/Font
% Substitutions
/SimSun-oldttf << /SubfontID 0 /CSI [(GB1) 2] /Path (/usr/local/share/ghostscript/9.02/Resource/Font/simsun.ttf) /FileType /TrueType >> ;
% Aliases
/Adobe-GB1 /SimSun-oldttf ;
/Adobe-Identity /SimSun-oldttf ;
/FZNBSJW--GB1-0 /SimSun-oldttf ;
/FZNBSJW--GB1 /SimSun-oldttf ;
#####################
/usr/local/bin/convert ~/test.pdf ~/111.png