LibreOffice can load Word documents and export them as PDF and it can be invoked on the command line:
soffice --convert-to pdf *.doc
or
soffice --convert-to pdf:writer_pdf_Export *.doc
Providing soffice is on your path will merrily convert all of your .doc files in the current directory to pdf. In my case soffice is located at "c:\Program Files\LibreOffice 5\program\soffice.bin"
- Free
- Offline
- Doesn't even need MS-Office installed
- Works from the command line, (or batch files),
- Cross platform, works on Windows, OS-X & Linux
- May have problems with complex documents, e.g. those that produce part of their content with VBA.
Testing on Windows 10 with LirbeOffice 5.2.6.2 shows that the second option above works fine with explicit filenames but not with wildcards so you may need to get a list of your doc files, dir /b *.doc > temp.txt
, and then edit it into a batch file.
Your temp.txt should be loaded into the editor and should looks something like:
Cv1.doc
cv2.doc
resignation.doc
letter_to_press.doc
Dont Know What.doc
An you need to edit this so that it looks like:
"C:\Program Files\LibreOffice 5\program\soffice.bin" --convert-to pdf:writer_pdf_Export Cv1.doc
"C:\Program Files\LibreOffice 5\program\soffice.bin" --convert-to pdf:writer_pdf_Export cv2.doc
"C:\Program Files\LibreOffice 5\program\soffice.bin" --convert-to pdf:writer_pdf_Export resignation.doc
"C:\Program Files\LibreOffice 5\program\soffice.bin" --convert-to pdf:writer_pdf_Export letter_to_press.doc
"C:\Program Files\LibreOffice 5\program\soffice.bin" --convert-to pdf:writer_pdf_Export "Dont Know What.doc"
Which is quick and easy to do with the paste command, (note that files with spaces in will need to be in quotes as shown), and save it as convert.bat
in the same directory as the files then simply run convert.bat
to convert all of your files.
Note that files with some "special" characters in the name will cause problems, spaces can be addressed by quoting the filename but others such as quotes, colons, semicolons, any of &|!<>
, etc., are likely to cause problems and should probably be renamed.