可以在线阅览文件服务器,Office 文件预览和编辑 – 开启 Office/PDF 文件在线预览 - Seafile 服务器用户手册...

Seafile 专业版服务器支持在线预览 office 文件,配置方法如下。

安装 Libreoffice/UNO

Office 预览依赖于 Libreoffice 4.1+ 和 Python-uno 库。

Ubuntu/Debian:

sudo apt-get install libreoffice libreoffice-script-provider-python poppler-utils

For older version of Ubuntu: sudo apt-get install libreoffice python-uno

Centos/RHEL:

sudo yum install libreoffice libreoffice-headless libreoffice-pyuno poppler-utils

你还需要安装字体文件:

Ubuntu/Debian:

# For ubuntu/debian

sudo apt-get install ttf-wqy-microhei ttf-wqy-zenhei xfonts-wqy

CentOS:

# For CentOS

sudo yum install wqy-microhei-fonts wqy-zenhei-fonts wqy-unibit-fonts -y

开启配置项

打开 conf/seafevents.conf, 添加:

[OFFICE CONVERTER]

enabled = true

保存后 seafevents.conf 重启 Seafile 服务 ./seafile.sh restart

其他配置选项

[OFFICE CONVERTER]

## How many libreoffice worker processes to run concurrenlty

workers = 1

## where to store the converted office/pdf files. Deafult is /tmp/.

outputdir = /tmp/

## how many pages are allowed to be previewed online. Default is 50 pages

max-pages = 50

## the max size of documents to allow to be previewed online, in MB. Default is 2 MB

## Preview a large file (for example >30M) online will freeze the browser.

max-size = 2

Office 预览不能工作,日志文件在哪?

你可以查看 logs/seafevents.log

Office 预览不能工作的一个可能原因是你的机器上的 libreoffice 版本太低,可以用以下方法修复

删除安装的 libreoffice:

sudo apt-get remove libreoffice* python-uno python3-uno

tar xf LibreOffice_4.1.6_Linux_x86-64_deb.tar.gz

cd LibreOffice_4.1.6.2_Linux_x86-64_deb

cd DEBS

sudo dpkg -i *.deb

重启 Seafile 服务

./seafile.sh restart

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值