centos6.5下安装openoffice+jodconverter+swftool+flexpaper工具实现在线预览文档功能
2017-02-09 10:25
956 查看
作用: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.gz
2、解压安装
#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.rpm
4、启动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.1
soffice -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.gz 2、安装依赖包
# yum -y install giflib-devel libjpeg-develfreetype-devel t1lib-devel zlib
3、解压
# tar zxvf swftools-2013-04-09-1007.tar.gz
# cd swftools-2013-04-09-1007
# ./configure
5.编译安装
# make && make install
6、
查询安装成功后的which pdf2swf目录
#which pdf2swf
/usr/local/bin/pdf2swf
QS:后来发现安装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-CN
3、下载
# 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.gz
4、解压,并且到RPMS下,安装所有的rpm包
# rpm -ivh *.rpm
5、开启服务(与openoffice一致)
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
四、参考文档:http://blog.csdn.net/cuker919/article/details/46389449
环境: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.gz
2、解压安装
#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.rpm
4、启动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.1
soffice -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.gz 2、安装依赖包
# yum -y install giflib-devel libjpeg-develfreetype-devel t1lib-devel zlib
3、解压
# tar zxvf swftools-2013-04-09-1007.tar.gz
# cd swftools-2013-04-09-1007
# ./configure
5.编译安装
# make && make install
6、
查询安装成功后的which pdf2swf目录
#which pdf2swf
/usr/local/bin/pdf2swf
QS:后来发现安装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-CN
3、下载
# 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.gz
4、解压,并且到RPMS下,安装所有的rpm包
# rpm -ivh *.rpm
5、开启服务(与openoffice一致)
soffice -headless -accept="socket,host=127.0.0.1,port=8100;urp;" -nofirststartwizard &
四、参考文档:http://blog.csdn.net/cuker919/article/details/46389449
相关文章推荐
- 利用jodconverter+openoffice+flexpaper实现的在线文档系统核心demo
- FlexPaper+OpenOffice实现web的在线文档预览功能
- Java实现文档在线预览(openoffice+swfTools+FlexPaper)
- Java实现文档在线预览(openoffice+swfTools+FlexPaper)
- 关于openoffice/libreoffice+swftools+jodconverter+flexpaper预览文件的一些问题
- 在线文档查阅-OpenOffice+SWFTool+FlexPaper
- 在线文档预览方案:openoffice+swftools+flexPaper
- JAVA Web项目中用OpenOffice+Swftools+Flexpaper实现在线预览,txt文件出现乱码!
- java对文档等、附件在线预览的详细开发步骤解析:openOffice+SwfTools+FlexPaper
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper](三) 之 使用JODConverter将office文档转换为pdf
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper](三) 之 使用JODConverter将office文档转换为pdf
- Openoffice+swfTools+flexPaper实现在线预览
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper](三) 之 使用JODConverter将office文档转换为pdf
- openOffice+jodConverter+jquery.media.js在线预览office、pdf、txt等文档
- java SpringMvc 实现文件在线预览(openoffice+swftools+flexpaper)
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper](三) 之 使用JODConverter将office文档转换为pdf
- 仿百度文库方案[openoffice.org 3+swftools+flexpaper] 使用JODConverter将office文档转换为pdf
- centos 7 安装 openoffice & java & jodconverter
- java实现附件预览(openoffice+swftools+flexpaper)