Skip to content

使用libreoffice+python实现的高效word转pdf项目,转换后的pdf容错率很低

Notifications You must be signed in to change notification settings

jiulingyun/word2pdf

Repository files navigation

使用libreoffice+python实现的高效word转pdf项目,转换后的pdf容错率很低

安装libreoffice

我这里以CentOS8为例,安装命令如下:

dnf install libreoffice

安装python3

我这里以CentOS8为例,安装命令如下:

dnf install python3

一键安装脚本

bash <(curl -Ls https://raw.githubusercontent.com/jiulingyun/word2pdf/master/install.sh)

使用方法

启动服务

systemctl start word2pdf

停止服务

systemctl stop word2pdf

重启服务

systemctl restart word2pdf

设置开机自启动

systemctl enable word2pdf

禁用开机自启

systemctl disable word2pdf

接口调用

其中headers中的Authorization参数就是配置文件settings.json中的key参数

POST 你的IP:5000/api/word2pdf
headers:
Authorization: DOoGAfpXpxcyGQW5koi9miRFgYGIkMB0
body:
{
    "doc_file": "经过base64编码的doc文件内容"
}
响应:
{
    "code": 1,
    "file_url": "pdf文件的url"
}

About

使用libreoffice+python实现的高效word转pdf项目,转换后的pdf容错率很低

Resources

Stars

Watchers

Forks

Packages

No packages published