中文支持安装:
1) mkdir –p /usr/share/xpdf
cd /usr/share/xpdf/
2) 下载中文支持及字体库
wget ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz
wget http://www.nginxs.com/download/font.zip
3) tar zxvf xpdf-chinese-simplified.tar.gz
unzip font.zip
mv Gbsn00lp.ttf gkai00mp.ttf xpdf-chinese-simplified/CMap/
cd /usr/share/xpdf/xpdf-chinese-simplified
4)vi add-to-xpdfrc
内容如下:
cidToUnicode Adobe-GB1 /usr/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode
unicodeMap ISO-2022-CN /usr/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap
unicodeMap EUC-CN /usr/share/xpdf/chinese-simplified/EUC-CN.unicodeMap
unicodeMap GBK /usr/share/xpdf/chinese-simplified/GBK.unicodeMap
cMapDir Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap
toUnicodeDir /usr/share/xpdf/chinese-simplified/CMap
displayCIDFontTT Adobe-GB1 /usr/share/xpdf/chinese-simplified/CMap/gkai00mp.ttf
保存后退出
4、相关Lib包安装:
1) yum –y install gcc-c++(如果已安装可跳过)
2) yum install giflib-devel.x86_64
3) yum install zlib-devel.x86_64
4) yum install freetype-devel.x86_64
5) yum install libjpeg-devel.x86_64
5、SwfTool安装:
1)cd /usr/local/
2)wget http://www.swftools.org/swftools-0.9.1.tar.gz
3)tar zxvf swftools-0.9.1.tar.gz
4)cd swftools-0.9.1
5)./configure --prefix=/usr/local/swftools/,可能报错,需要添加--build=i686-pc-linux-gnu:
6)make
7)make install
8)测试一下是否可用
pdf2swf -o /path/output.swf -T -z -t -f /path/yourpdffile.pdf -s languagedir=/usr/share/xpdf/xpdf-chinese-simplified -s flashversion=9
tar -zvxf swftools-0.x.x.tar cd swftools-0.x.x ./configure make make install
* freetype: http://www.freetype.org * jpeglib: http://www.ijg.org/files/
libjpeg-6a can be found here - ftp://sunsite.unc.edu/pub/Linux/libs/graphics/ libjpeg 6b1-2 debs here - http://packages.debian.org/search?keywords=libjpeg6
* cd swftools/lib/pdf * wget ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.03.tar.gz * cd ../../ * ./configure [ -- your_compiler_flags ]
checking for missing libraries... ungif gif_lib.h *************************************************** * The following headers/libraries are missing: ungif gif_lib.h * Disabling gif2swf tool... ***************************************************
rm -f config.cache LDFLAGS="-L/usr/local/lib" CPPFLAGS="-I/usr/local/include" ./configure
ranlib /usr/local/lib/libjpeg.a ldconfig /usr/local/lib
make install-lib make install-headers
LDFLAGS=-lstdc++ ./configure