centos 安裝swftools

破棉襖發表於2014-11-04
1.安裝gcc c++
   yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel


2.安裝freetype
   $wget 
   $tar xvf freetype-2.4.8.tar.bz2
   $cd freetype-2.4.8
   $./configure
   $make&&sudo make install

3.安裝jpeglib
   $wget 
   $tar xvf jpegsrc.v8d.tar.gz
   $cd jpegsrc.v8d
   $./configure
   $sudo make&&sudo make install


4.安裝zlib
   $wget 
   $tar xvf zlib-1.2.6.tar.gz
   $cd zlib-1.2.6
   $./configure
   $make&&sudo make install


5.下載 swftools-0.9.2.tar.gz  並解壓安裝
$wget 
$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
    成功
 
6.設定環境變數
vim /etc/profile
export PATH=$PATH:/usr/swftools/bin/



7.安裝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
    內容如下:
    cidToUnicode   Adobe-GB1       /usr/share/xpdf/xpdf-chinese-simplified/Adobe-GB1.cidToUnicode
    unicodeMap     ISO-2022-CN    /usr/share/xpdf/xpdf-chinese-simplified/ISO-2022-CN.unicodeMap
    unicodeMap     EUC-CN             /usr/share/xpdf/xpdf-chinese-simplified/EUC-CN.unicodeMap
    unicodeMap     GBK           /usr/share/xpdf/xpdf-chinese-simplified/GBK.unicodeMap
    cMapDir            Adobe-GB1       /usr/share/xpdf/xpdf-chinese-simplified/CMap
    toUnicodeDir                      /usr/share/xpdf/xpdf-chinese-simplified/CMap
    displayCIDFontTT Adobe-GB1 /usr/share/xpdf/xpdf-chinese-simplified/CMap/gkai00mp.ttf
    儲存後退出

8.測試
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"  

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29754888/viewspace-1320143/,如需轉載,請註明出處,否則將追究法律責任。

相關文章