Home » Questions » Computers [ Ask a new question ]

Batch convert Word documents to PDFs

Batch convert Word documents to PDFs

How do I batch convert many Word documents and have them saved as [originalfilename].pdf?

Asked by: Guest | Views: 258
Total answers/comments: 5
Guest [Entry]

"This is how I would do it:

Download CutePDF writer
Set the writer as your default printer (you can change it back later)
Place all your .doc files in the same folder
Highlight all the files, right-click, Print

Only downside is that you have to click Ok once for each file."
Guest [Entry]

well, cutepdf & pdf99 do their job well, but i find PDFcreator more appealing as it 'print's in higher quality than the other two, it also has more configuration option, plus it's open-source.
Guest [Entry]

"Regarding the SaveAsPDF.js script that a previous user posted. This worked for converting one pdf file, but i didnt know how to covert all the files in a directory. With a little playing I created a file. CovertAll2PDF.bat with the following 2 lines:

echo off
for %%X in (*.doc) do cscript.exe //nologo SaveAsPDF.js ""%%X""

there is also the /r ""Parent Directory"" which can be inserted as for /r ""PD"" %%X in -.... which will go through all the directories, in that case make it C:\SaveAsPDF.js and save Saveaspdf.js in that directory.

I'm sure its clumsy, but it worked for me. hope this helps someone."
Guest [Entry]

"This little snippet worked very well for me.

Free
Easy
No limits on number of files

$Word=New-Object -ComObject Word.Application

$Files=Get-ChildItem "".\*.docx""

ForEach ($File In $Files) {
$Document=$Word.Documents.Open($File.FullName)

$Name=($Document.FullName).Replace(""docx"", ""pdf"")

$Document.SaveAs([ref] $Name, [ref] 17)
$Document.Close()
}

$Word.Close()

Just save it to a PowerShell script like Convert-Documents.ps1 and then run it from the command line from within the folder where all your source documents are located."
Guest [Entry]

"I've not tried it but there is a batch method using OpenOfficedotorg that you could test. Instructions on doing this on GNU/Linux and Windows platforms described at http://www.tech-faq.com/convert-word-to-pdf.shtml (and also at http://www.togaware.com/linux/survivor/Convert_MS_Word.html"" and, at http://www.oooforumdotorg/forum/viewtopic.phtml?t=3772).

The principle of using OpenOfficedotorg to read in the .doc file and then export it as a PDF seems sound if you find OpenOfficedotorg makes areasonable job of opening the .doc files you have."