代码拉取完成,页面将自动刷新
在线体验地址(不会经常更新,保留最基本的预览功能) : http://39.97.98.75:8082/view/upload
Word、Excel、PPT转码为PDF
PDF转码为图片
对Word,Excel,PPT和PDF的图片式在线预览
本地上传预览
MarkDown文件预览
Excel转html
.
├── app
│ ├── api 控制器
│ ├── model 结构体定义
| |—— service 业务逻辑
├── cache
│ ├── convert 转图片后的文件
│ ├── download 预览文件下载目录
│ ├── local 本地预览上传
│ └── pdf 转pdf后的文件
├── config
│ └── config.toml 配置文件
├── library 公共方法
├── log 日志
├── main.go
├── public
│ ├── html 前端资源html,css,js
│ └── index.html 首页
├── router
│ └── router.go 路由
├── template 模板
│ └── index.html 本地上传页面
因为没有推送远程镜像,所以需要自己手动打包镜像
0 : 安装docker
1 : git clone https://github.com/CZHIC/GoViewFIle.git
2 : 进入GoViewFIle 目录
3 : 打包镜像 docker build -t goviewfile:v0.7 .
4 : 查看镜像 docker images
5 : 运行容器 docker run -d -p 8082:8082 goviewfile:v0.7
准备
1.安装Libreoffice,下载官方msi包,傻瓜式安装即可 (https://zh-cn.libreoffice.org)
2.将Libreoffice安装路径下的program文件夹加入PATH中
3.安装ImageMagick,官方包,傻瓜式安装即可,安装7.0以上版本 (https://ghostscript.com/download/gsdnld.html)
4.安装GhostScript,官方包,傻瓜式安装即可 (https://ghostscript.com/download/gsdnld.html)
编译
1.git clone https://github.com/CZHIC/GoViewFIle.git
2.cd GoViewFIle
3.go build
运行
GoViewFile.exe
准备
1.安装Libreoffice:yum install libreoffice
2.安装ImageMagick:yum install imagemagick
4.修改ImageMagick的配置,vi etc/ImageMagick-6/policy.xml
修改
<policy domain="coder" rights="none" pattern="PDF" />
为
<policy domain="coder" rights="read|write" pattern="PDF" />
下方新增一行
<policy domain="coder" rights="read|write" pattern="LABEL" />
wq退出保存
5 如果出现报错
yum install libreoffice-headless
yum install libreoffice-writer
export DISPLAY=:0.0
5.安装字体(如果出现乱码)
打包一台Windows机器的C:\Windows\Fonts下的所有文件
发送到Linux机器上
解压后进入Fonts文件夹,依次执行mkfontscale,mkfontdir,fc-cache
编译
1.git clone https://github.com/CZHIC/GoViewFIle.git
2.cd GoViewFIle
3.go build
运行
1. ./GoViewFIle
远程预览: http://127.0.0.1:8082//view/view?url=被预览文件的url
本地上传: http://127.0.0.1:8082/view/upload
首页 : http://127.0.0.1:8082
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。