美文网首页
关于word文件转换为pdf文件

关于word文件转换为pdf文件

作者: Zzzzzzzz525 | 来源:发表于2018-12-11 10:36 被阅读0次

1、centos下安装libreoffice

sudo yum install libreoffice

2、命令行执行word转pdf

将 /mnt/hgfs/test.docx目录下的test.docx转成pdf存放到 /mnt/hgfs 目录下:

libreoffice --headless --convert-to pdf:writer_pdf_Export /mnt/hgfs/test.docx --outdir /mnt/hgfs

3、如果出现以下错误

 /usr/lib64/libreoffice/program/soffice.bin X11 error: Can't open display:
Set DISPLAY environment variable, use -display option
or check permissions of your X-Server
 (See "man X" resp. "man xhost" for details)

-- 执行 sudo  yum install libreoffice-headless即可 

参考:

1、https://www.jb51.net/article/127358.htm

2、https://blog.csdn.net/pwtitle/article/details/51684685

相关文章

网友评论

      本文标题:关于word文件转换为pdf文件

      本文链接:https://www.haomeiwen.com/subject/pdlshqtx.html