1.安装libreoffice
下载 libreoffice安装包 https://www.libreoffice.org/download/download/
上传到linux 使用rz 没有需要安装 yum install lrzsz
解压 tar -zxvf LibreOffice_6.2.4_Linux_x86-64_rpm.tar.gz 进入解压文件
安装 不使用insatll 采用yum安装
cd RPMS/ yum install *.rpm
安装完成后 使用命令测试
cd /opt/libreoffice6.2/ ./soffice --headless --convert-to pdf /home/appData/dsavyd.docx --outdir /home/appData/
运行报错
/opt/libreoffice6.0/program/soffice.bin: error while loading shared libraries: libSM.so.6: cannot open shared object file: No such file or directory
则需要安装 ibus
yum install ibus
查看转换后的文件 /home/appData/dsavyd.pdf 使用sz下载到window上查看 乱码方案 添加中文字体到linux上
cd /usr/share/fonts/ mkdir chinese cd chinese sz上传中文字体文件 vi /etc/fonts/fonts.conf 如下图添加中文字体目录
fc-cache 刷新字体缓存
fc-list 查看字体