Linux下 swftools openoffice3安装

 一、首先安装openoffice3,openoffice3下载地址:http://www.openoffice.org/download/other.html下载最新版,解压后需要xwindows 环境安装,最好起个vncserver 安装。方便,安装完成后停掉vncserver即可。

      二、安装swftools 工具,下载地址:

     http://www.swftools.org/download.html 最新版是swftools-0.9.1.tar.gz

                tar zxvf swftools-0.9.1.tar.gz

              cd  swftools-0.9.1

yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpnglibpng-develfreetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibcglibc-develglib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curlcurl-devele2fsprogs e2fsprogs-devel krb5-server krb5-devel libidn libidn-developenldapopenldap-devel nss_ldap openldap-clients openldap-servers

             ./configure --prefix=/usr/local/swftools && make && make install

    三、下载 xpdf-chinese-simplified.tar.gz,下载地址为:ftp://ftp.foolabs.com/pub/xpdf/

             当前最新版是 20110902 的版本

             wget  ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-traditional.tar.gz

             tar zxvf xpdf-chinese-traditional.tar.gz

             mkdir /usr/local/share/xpdf

             mv xpdf-chinese-traditional /usr/local/share/xpdf/chinese-simplified

              cd  /usr/local/share/xpdf/chinese-simplified

              echo "displayCIDFontTT        Adobe-GB1 /usr/local/share/xpdf/chinese-simplified/CMap/gbsn00lp.ttf">>add-to-xpdfrc

             上传win字体,不然某些字体会出现乱码,我自己的用的字体下载,http://115.com/file/e7bqk96c#gbsn00lp.rar。
  添加环境变量:

              echo "export PATH=$PATH:/usr/local/swftools/bin/">>/etc/profile

              source /etc/profile

    四、测试

    pdf2swf -s languagedir=/usr/local/share/xpdf/xpdf-chinese -T 9  -s zoom=150 -s ppmsubpixels=1 -s poly2bitmap=1 -s bitmapfonts=1  "./test.pdf" -o "%.swf"

    然后看看转换是否成功。

    五、自动启动

    java 之类的程序要调用的话,需要启动openoffice,所以加入到启动中,完事大吉。

    echo "##########################">>/etc/rc.local

    echo "unset DISPLAY">>/etc/rc.local

    echo "/opt/openoffice.org3/program/soffice.bin -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &">>/etc/rc.local


出错时:

locate libuno_sal.so.3
echo /usr/lib64/libreoffice/ure/lib/ > /etc/ld.so.conf.d/openoffice3.conf

ldconfig


你可能感兴趣的:(Linux下 swftools openoffice3安装)