这里只考虑centos系统。首先,安装字体(防止你的PDF转换成乱码)cd/usr/share/fontswgethttps://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-sans/SubsetOTF/SourceHanSansCN.zipwgethttps://mirrors.tuna.tsinghua.edu.cn/adobe-fonts/source-han-serif/SubsetOTF/SourceHanSerifCN.zipunzipSourceHanSansCN.zipunzipSourceHanSerifCN.ziprm-rfSourceHanSerifCN.ziprm-rfSourceHanSerifCN.zipfc-cache-fvinstalllibreofficeyuminstalllibreoffice-headlessyuminstalllibreoffice-writer下面是验证是否可用cd/tmp#touchtest.docx你的word文档libreoffice--headless--convert-topdf--outdir/tmp/tmp/test.docx但这不会导出Word注释。如果要导出,可以(2选1)打开libreoffice手动导出pdf,选择导出注释和占位符加参数:--convert-topdf:"impress_pdf_Export:ExportNotes=True:ExportNotesPages=True:ExportBookmarksToPDFDestination=True“
