下载 https://zh-cn.libreoffice.org/get-help/install-howto/linux/
下载安装包
Linux系统下的安装包请到下载页面获取。有两种打包方式:适用于 Debian/Ubuntu 的 ".deb" 包,以及适用于 Fedora/SUSE/Mandriva 的 ".rpm" 包。请选择适合您的操作系统的类型。
# 解压
tar -vzxf LibreOffice_7.1.8_Linux_x86-64_deb.tar.gz
cd LibreOffice_7.1.8.1_Linux_x86-64_deb
# 安装
sudo dpkg -i ./DEBS/*.deb
一鍵安裝
sudo snap install libreoffice or sudo apt install libreoffice-common
命令
'libreoffice --headless --convert-to pdf'.split() + [docPath] + ['--outdir'] + [pdfPath]
服务器字库问题
• 服务器如果不带中⽂字库可能会导致word转换pdf出现乱码情况
• 解决⽅法:将uming.ttc放到/usr/share/fonts/truetype/arphic/⽬录下,如果没有⽂件夹就创建
uming.ttc 下载
链接:https://pan.baidu.com/s/1zxFfPIbLwCuy-itNydG5Mw
提取码:wvps
--来自百度网盘超级会员V5的分享
fc-list :lang=zh 查看当前⽀持字库
• sudo chmod 744 /usr/share/fonts/truetype/arphic/uming.ttc
• sudo mkfontscale ⽣成核⼼字体信息
• sudo mkfontdir
• sudo fc-cache -fv