Is there any GNU/Linux command line utility that converts .doc(x) files to .pdf? [closed]

Closed. This question is seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. It does not meet Stack Overflow guidelines. It is not currently accepting answers.

We don’t allow questions seeking recommendations for software libraries, tutorials, tools, books, or other off-site resources. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago .

Surely, I am the 100th user who is asking this but after I have searched through similar topics here and on other websites I still cannot find what I need. I like to have a simple command line tool for my GNU/Linux which converts .doc(x) files to .pdf BUT the output should look the same as the original. LibreOffice doesn't seem like a good choice for this because it does not convert well in some cases. I have found a website freepdfconvert.com which does the job very well, but I cannot upload any sensitive files since it is a big risk. I don't say they would do anything bad with them but it is how it is. If I can't find any good tool maybe I will have to write one myself.

33.7k 26 26 gold badges 151 151 silver badges 175 175 bronze badges asked Jan 18, 2014 at 11:45 user3209690 user3209690

I never have done before but I googled and I found this video tutorial: youtube.com/watch?v=RzxwJAeFMSc It uses an application called AbiWord. There are a lot of posts on this website to convert doc to pdf but I didn't know if any are 1:1. I'm sure you can do your app. I recommend you begin here: stackoverflow.com/questions/6011115/doc-to-pdf-using-python.

Commented Jan 18, 2014 at 11:52

2 Answers 2

Unfortunately there are no Linux-based guaranteed 1-to-1 convertors for Word (doc/docx) to PDF. This is because Word, a Microsoft product, uses a proprietary format that changes slightly with every release. As it was not traditionally a publicly documented format and Microsoft does not port Word/Office to Linux (nor ever will) then you must rely upon reverse engineered third party tools for older formats (doc) and proper interpretation of the Office Open XML format by third party developers.

We found the best open source solution is LibreOffice (which was forked from OpenOffice.org, which itself was called Star Office before it was open sourced). It is much more actively developed than AbiWord, as another answer suggested.

The usage from the command line is simple and well documented with plenty of examples:

soffice --headless --convert-to pdf filename.doc 

Or also you can use libreoffice instead of soffice on newer versions.