---
title: "linux下安装swftools和openOffice"
author: "jiangtie"
date: "2015-07-03T17:09:15Z"
tags: []
categories: ["编程语言"]
slug: "linux-swftools-openoffice"
draft: false
lastmod: "2015-07-03T17:09:15Z"
id: 2224124
url: "https://jiangtie.iteye.com/blog/2224124"
---

最近公司实现一个仿豆丁网百度文库阅读器的功能，需要用到两个软件swftools和openOffice，两个软件win平台运行正常，公司linux服务器运行遇到一些麻烦，下面我把linux平台安装顺序记录下来以做以后参考也分享给大家：
    系统：linux centerOS 5.6 X64  软件下载版本自选
    这里我下载的软件都是老版本，新版本安装不通过。系统有些老，大家可以根据自己系统选择下载。
    一、swftools下载：
      http://www.swftools.org/download.html
      下载 swftools-0.9.1.tar.gz 
 
    二、openOffice下载：
      http://download.openoffice.org/all_rc.html#untested-full   
      Linux x86-64 RPM     
      OOo_3.3.0_Linux_x86-64_install-rpm-wJRE_zh-CN.tar.gz
 
    三、swftools安装：     
    1、安装所需的库和组件。机器之前安装过了，主要安装的是下面几个组件。yum install gcc* automake zlib-devel libjpeg-devel giflib-devel freetype-devel
    2、下载编译安装swftools。
       tar vxzf swftools-0.9.1.tar.gz
      cd swftools-0.9.1
      ./configure --prefix=/usr/local/swftools
      make
      make install
    3、设置swftools环境变量，使pdf2swf成为一个可执行命令
      vim /etc/profile
     export PATH=$PATH:/usr/local/swftools/bin/
    4、安装xpdf语言包。下载xpdf-chinese-simplified.tar.gz(ftp://ftp.foolabs.com/pub/xpdf/xpdf-chinese-simplified.tar.gz)文件，解压到/usr/local下，编辑add-to-xpdfrc文件，如下：
      vim /usr/local/xpdf-chinese-simplified/add-to-xpdfrc
     fontDir /usr/share/fonts/win
      displayCIDFontTT Adobe-GB1 /usr/share/fonts/win/simhei.ttf
      字体文件自己下载…
    5、最后使用如下转换命令测试：
     pdf2swf -s languagedir=/usr/local/xpdf-chinese-simplified -T 9 -s poly2bitmap -s zoom=150 -s flashversion=9 "/opt/123.pdf" -o "/opt/test/%.swf"
 
    四、openOffice安装：
      1、解压安装包。
        # tar －zxvf OOo_3.3.0_Linux_x86-64_install-rpm-wJRE_zh-CN.tar.gz
        解压后，会得到OOO330_m20_native_packed-1_zh-CN.9567目录。
      2、（进入RPMS目录）安装OpenOffice的所有组件
        # rpm -ivh openoffice*.rpm
      3、（进入RPMS/desktop-integration目录）安装OpenOffice的桌面控制台desktop-integration
        # cd desktop-integration
        # rpm -ivh openoffice.org3.2-redhat-menus-3.2-9472.noarch.rpm
        注意：安装这个桌面配置环境的时候，应根据自己的系统选择合理的配置文件包。
      4、启动openOffice
        cd /opt/openoffice.org3/program
        #soffice -headless -accept="socket,host=localhost,port=8100:urp;" -nofirststartwizard &
        或：/opt/openoffice.org3/program/soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
      
参阅文档：http://tetop.blog.51cto.com/1883288/817509
          http://hi.baidu.com/nessus1/item/a714b5020a2c21d81ff046d0
          http://www.doc88.com/p-296361017943.html
          http://www.blogjava.net/hongjunli/archive/2010/05/27/322037.html




reference:http://blog.sina.com.cn/s/blog_684f1c2701013j26.html