Windows – Batch convert docx files to pdf

conversionmicrosoft wordpdfwindows 10

I have many DOCX files (of Office 365) that I need to convert to PDF. I can open each one of them and export to PDF, but I am looking for a faster solution that can run in a batch file.
One option that almost works is to use LibreOffice as explained here. It works for simple docx files, but for more complex files (e.g. with images and rtl text) it messes up the layout of the file.
Is there a way to do the same with MS Word?

Best Answer

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.

Related Question