centos 7 下安装kkFileView-2.2.0
1.下载地址:https://gitee.com/kekingcn/file-online-preview/releases
官方文档: https://gitee.com/kekingcn/file-online-preview/wikis/Home
本项目不需要集成到你所应用的项目中,单独部署,启动服务,调用即可。
2.解压文件 任意目录 本人在 usr/local下
tar -zxvf kkFileView-2.2.0.tar.gz
3.运行以下命令
yum install -y libXext.x86_64
yum groupinstall -y “X Window System”
注意:jdk1.8
4.查看openoffice是否启动
(1)进入openoffice的安装目
cd /opt/openoffice4/program/
(2)查看是否启动
若只有以下红线圈住的地方,说明还未启动
启动命令:
./soffice -headless -accept=“socket,host=127.0.0.1,port=8100:urp;” -nofirststartwizard &
启动成功如(2)中的第一个图
5.启动kk-view
cd usr/local/kkFileView-2.2.0/bin
sh startup.sh
启动成功:
输入 ip:8012,出现如下图,说明启动成功,若未出现下图的界面,请查看防火墙是否关闭
也可以直接调用(本人测试地址) http://192.168.1.89:8012/onlinePreview?url=文件地址
http://192.168.1.89:8012/onlinePreview?url=http%3A%2F%2F192.168.1.89%3A8012%2Fdemo%2F%E5%A8%B1%E4%B9%90%E4%B8%9A.xlsx