doc.docx.pdf_如何在Linux上的命令行中将.docx .doc MS Word文件转换为pdf

doc.docx.pdf

How to convert a MS Word document file such as .docx and .doc to pdf on Linux using command line tools?

如何在Linux上使用命令行工具将MS Word文档文件(例如.docx和.doc)转换为pdf?

Use LibreOffice:

使用LibreOffice:

libreoffice --headless --convert-to pdf 
--outdir /path/to/out/dir/ /path/to/doc/docx/file
Answered by Eric Z Ma.
埃里克·马(Eric Z Ma)回答。


While this LibreOffice answer works, the –headless option still needs as display, even though it does not use it. In otherwords, this option won’t work on a truely headless server or from a cron or batch job, unless you fire up a dummy X server (eg xvfb). The LibreOffice people don’t seem inclined to “fix” this:

尽管此LibreOffice答案有效,但–headless选项仍需要显示,即使它不使用它。 换句话说,除非您启动虚拟X服务器(例如xvfb),否则该选项在真正的无头服务器或cron或批处理作业中将不起作用。 LibreOffice人员似乎不倾向于“解决”此问题:

https://bugs.documentfoundation.org/show_bug.cgi?id=107151

https://bugs.documentfoundation.org/show_bug.cgi?id=107151



Hi Robert, thanks for the notes!

嗨罗伯特,谢谢你的笔记!

So in a server without a real X, it seems a command like this is needed (not yet tested):

因此,在没有实数X的服务器中,似乎需要这样的命令(尚未测试):

xvfb-run libreoffice --headless --convert-to pdf 
--outdir /path/to/out/dir/ /path/to/doc/docx/file

to make it run by cron or in background.

使它由cron或在后台运行。



TextMaker, the word processor included in SoftMaker FreeOffice, has a much better compatibility with Microsoft Word compared to LibreOffice. You should download FreeOffice without charge, open your doc/docx documents faithfully with TextMaker, press the pdf button, and get a perfect pdf file.

与LibreOffice相比,SoftMaker FreeOffice中包含的文字处理器TextMaker与Microsoft Word具有更好的兼容性。 您应该免费下载FreeOffice,使用TextMaker忠实地打开doc / docx文档,按pdf按钮,然后获得一个完美的pdf文件。

freeoffice.com

freeoffice.com



Does FreeOffice provides a command-line method to generate PDF from word .doc or .docx files? That is required to automatically generating many files.

FreeOffice是否提供了从Word .doc或.docx 文件生成PDF的命令行方法? 这是自动生成许多文件所必需的。

翻译自: https://www.systutorials.com/how-to-convert-a-docx-doc-ms-word-file-to-pdf-in-command-line-on-linux/

doc.docx.pdf

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值