How to convert Word (doc) to PDF from Windows command line?

"winword.exe" "C:\My Files\doc1.doc" /mFilePrintDefault 

Provided you have quiet PDF printer as default.

Also, try LibreOffice offspring from OpenOffice.org. It is based on go-ooo which had no problems with OLE metrics in Office.


  1. if you have Microsoft Word installed, you can use DocTo:

    https://github.com/tobya/DocTo

    batch operation is supported, all files in directory can be converted from doc to pdf:

    docto -f "C:\Dir with Spaces\FilesToConvert\" -O "C:\DirToOutput" -T wdFormatPDF  -OX .pdf
    
  2. another option is to use the following powershell script: https://gallery.technet.microsoft.com/office/Script-to-convert-Word-f702844d


If you have Microsoft Word installed, you can use the docx2pdf command line utility to batch convert docx to pdf on windows or macos. https://github.com/AlJohri/docx2pdf

Install:

pip install docx2pdf

Run:

docx2pdf myfolder/

Disclaimer: I wrote this tool after struggling to find a cross-platform solution for batch converting docx to pdf with zero formatting issues since it directly uses Microsoft Word.


I found this site, and by testing OfficeToPDF, it is apparently working well. Example:

OfficeToPDF "c​​:\help.doc" "c:\output\help.pdf"