首页 > 系统 > CentOS > 正文

centos6.5下安装openoffice+jodconverter+swftool+flexpaper工具实现在线预览文档功能

2024-06-28 16:02:27
字体:
来源:转载
供稿:网友
作用:linux下文档服务器上传文档转换成pdf文档,再由swftool工具转换成swf文件实现在线预览环境:OS   centos6.5          java环境软件包:Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz  http://sourceforge.net/PRojects/openofficeorg.mirror/files/4.1.3/binaries/zh-CN/Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz             jodconverter-2.2.2.zip              swftools-2013-04-09-1007.tar.gz   http://www.swftools.org/swftools-2013-04-09-1007.tar.gz一、openoffice的安装1、下载linux下的安装包http://www.openoffice.org/  http://sourceforge.net/projects/jodconverter/files/我下载的是最新版本# cd /usr/local/src# wget http://sourceforge.net/projects/openofficeorg.mirror/files/4.1.3/binaries/zh-CN/Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz2、解压安装#tar zxvf Apache_OpenOffice_4.1.3_Linux_x86-64_install-rpm_zh-CN.tar.gz# cd zh-CN/RPMS# rpm -ivh *.rpm      #安装所有rpm包3、进入到desktop-integration目录,选择安装相关的套件,我选择的是redhat# rpm -ivh openoffice4.1.3-redhat-menus-4.1.3-9783.noarch.rpm4、启动openoffic服务,安装在/opt下进入opt下的openofiice4目录:# cd /opt/openoffice4/program启动服务# soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard & 查看端口已经正常启动;二、jodconvert的安装测试下载jodconvert包然后解压,找到jar包执行路径/usr/local/jodconverter/lib/jodconverter-cli-2.2.2.jar测试java -jar /usr/local/jodconverter/lib /jodconverter-cli-2.2.2.jar test.doc test.pdf发现生成pdf文件,说明openoffice安装启动成功服务加入开机自启动#vim /etc/rc.local#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.#route add default gw 192.168.50.1soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &touch /var/lock/subsys/local三、swftools安装 1、下载地址 http://www.swftools.org/download.html# wget http://www.swftools.org/swftools-2013-04-09-1007.tar.gz2、安装依赖包#  yum -y install giflib-devel libjpeg-develfreetype-devel t1lib-devel zlib3、解压# tar zxvf swftools-2013-04-09-1007.tar.gz# cd swftools-2013-04-09-1007# ./configure5.编译安装# make && make install6、查询安装成功后的which pdf2swf目录#which pdf2swf/usr/local/bin/pdf2swfQS:后来发现安装openoffice转换效果并不理想,首先是速度较慢,再就是很多旧文档,文件格式支持性不好,部分文档不能转换,于是乎安装libreoffice步骤与openoffice差不多1、官网打开http://zh-cn.libreoffice.org/download/libreoffice-still/2、下载稳定版本http://zh-cn.libreoffice.org/download/libreoffice-still/?type=rpm-x86_64&version=5.2&lang=zh-CN3、下载# wget http://mirrors.ustc.edu.cn/tdf/libreoffice/stable/5.2.5/rpm/x86_64/LibreOffice_5.2.5_Linux_x86-64_rpm.tar.gz下载中文支持包# wget http://download.documentfoundation.org/libreoffice/stable/5.2.5/rpm/x86_64/LibreOffice_5.2.5_Linux_x86-64_rpm_langpack_zh-CN.tar.gz4、解压,并且到RPMS下,安装所有的rpm包# rpm -ivh *.rpm5、开启服务(与openoffice一致)soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard & 四、参考文档:http://blog.csdn.net/cuker919/article/details/46389449
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表