How to convert a .docx .doc MS Word file to pdf in command line on Linux

How to convert a MS Word document file such as .docx and .doc to pdf on Linux using command line tools? Use LibreOffice: libreoffice –headless –convert-to pdf –outdir /path/to/out/dir/ /path/to/doc/docx/file Answered by Eric Z Ma. While this LibreOffice answer works, the –headless option still needs as display, even though it does not use it. In […]