标签:
1,安装
先安装依赖包
yum install gcc* automake zlib-devel libjpeg-devel giflib-devel freetype-devel
# 安装freetype $wget http://nchc.dl.sourceforge.net/project/freetype/freetype2/2.4.8/freetype-2.4.8.tar.bz2 $tar xvf freetype-2.4.8.tar.bz2 $cd freetype-2.4.8 $./configure $make&&sudo make install
# 安装jpeglib $wget http://www.ijg.org/files/jpegsrc.v8d.tar.gz $tar xvf jpegsrc.v8d.tar.gz $cd jpegsrc.v8d $./configure $sudo make&&sudo make install
# 安装zlib $wget http://nchc.dl.sourceforge.net/project/libpng/zlib/1.2.6/zlib-1.2.6.tar.gz $tar xvf zlib-1.2.6.tar.gz $cd zlib-1.2.6 $./configure $make&&sudo make install
yum安装swftools
yum install swftools
源码安装swftools
$wget http://www.swftools.org/swftools-0.9.2.tar.gz $tar vxzf swftools-0.9.2.tar.gz $cd swftools-0.9.2 $./configure --prefix=/usr/swftools $make $make install #可能遇到的问题 modules/.././types.h:39:2: 错误:#error "no way to define 64 bit integer" modules/.././types.h:42:2: 错误:#error "don‘t know how to define 32 bit integer" modules/.././types.h:45:2: 错误:#error "don‘t know how to define 16 bit integer" modules/.././types.h:48:2: 错误:#error "don‘t know how to define 8 bit integer" #解决方法: [root~]# ldconfig /usr/local/lib #然后再执行 [root~]# ldconfig /usr/local/lib [root~]# ./configure #还可能遇到的问题 make[1]: *** [install] 错误 1 make[1]: Leaving directory `/root/swftools-0.9.2/swfs‘ make: *** [install] 错误 2 #解决方法: #将swfs目录下的Makefile和Makefile.in两个文件中的 -o -L 去掉 make install #成功
设置swftools环境变量
vim /etc/profile export PATH=$PATH:/usr/swftools/bin/
2,安装xpdf
yum安装
yum install xpdf
源码安装
#安装xpdf语言包,下载xpdf-chinese-simplified.tar.gz文件,解压到/usr/share/xpdf下,编辑add-to-xpdfrc文件,如下: 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 vi add-to-xpdfrc
add-to-xpdfrc
源文件内容
#----- begin Chinese Simplified support package (2011-sep-02) cidToUnicode Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode unicodeMap ISO-2022-CN /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap unicodeMap EUC-CN /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap #fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf #----- end Chinese Simplified support package
linux修改后的内容
#----- begin Chinese Simplified support package (2011-sep-02) cidToUnicode Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/Adobe-GB1.cidToUnicode unicodeMap ISO-2022-CN /usr/local/share/xpdf/chinese-simplified/ISO-2022-CN.unicodeMap unicodeMap EUC-CN /usr/local/share/xpdf/chinese-simplified/EUC-CN.unicodeMap unicodeMap GBK /usr/local/share/xpdf/chinese-simplified/GBK.unicodeMap cMapDir Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap toUnicodeDir /usr/local/share/xpdf/chinese-simplified/CMap displayCIDFontTT Adobe-GB1 /usr/share/xpdf-chinese-simplified/CMap/STSONG.TTF #fontFileCC Adobe-GB1 /usr/..../gkai00mp.ttf #----- end Chinese Simplified support package
windows修改后的内容
#----- begin Chinese Simplified support package (2011-sep-02) cidToUnicode Adobe-GB1 D:/xpdf-chinese-simplified/Adobe-GB1.cidToUnicode unicodeMap ISO-2022-CN D:/xpdf-chinese-simplified/ISO-2022-CN.unicodeMap unicodeMap EUC-CN D:/xpdf-chinese-simplified/EUC-CN.unicodeMap unicodeMap GBK D:/xpdf-chinese-simplified/GBK.unicodeMap cMapDir Adobe-GB1 D:/xpdf-chinese-simplified/CMap toUnicodeDir D:/xpdf-chinese-simplified/CMap displayCIDFontTT Adobe-GB1 D:/xpdf-chinese-simplified/CMap/STSONG.TTF #fontFileCC Adobe-GB1 D:/xpdf-chinese-simplified/gkai00mp.ttf #----- end Chinese Simplified support package
测试
pdf2swf -s languagedir=/usr/share/xpdf/xpdf-chinese-simplified -T 9 -s poly2bitmap -s zoom=150 -s flashversion=9 "/opt/123.pdf" -o "/opt/test/%.swf"
标签:
原文地址:http://my.oschina.net/yangting880815/blog/484755