6

Say I have several Word files in a folder. Is there a way to generate a batch of PDFs from these files?

5

Provided you have MS Word (or any other app that can open MS Word files) installed, you can use Automator. Here is a step by step guide on how to set it up for your needs: http://aseriesoftubes.com/articles/how-to-batch-convert-doc-files-to-pdf-format-using-mac-osx-automator/

Brief overview of the whole process:

  1. Open Automator
  2. Create a new workflow
  3. From the library panel on the left, select Files & Folders then double-click Get Specified Finder Items
  4. Add the all the files to convert
  5. From the library panel, now select Documents, then double click Convert Format of Word Documents
  6. From the dropdown menu, select Portable Document Format (PDF)
  7. Finally, click the Run button, and it will convert all the files and save them in the same folder where the original Word files are.
|improve this answer|||||
  • 1
    I don't see this option (Convert Format of Word Documents) in Automator in OS X El Capitan. Did it get removed? – n8henrie Jul 18 '16 at 14:30
  • 4
    Office 2016 has dropped Automator support. Could this be the reason you can't see that option? – molgar Jul 18 '16 at 15:10
7

One option using the command line would be to use pandoc (which requires LaTeX for PDF generation).

  1. Install pandoc and LaTeX. Because LaTeX is so big, I installed BasicTeX as recommended in the pandoc docs. With Homebrew and Homebrew Cask: brew install pandoc && brew cask install basictex
  2. Make sure the Word files are in .docx format. If they are in .doc format, you can convert them with OS X's built-in textutil: textutil -convert docx *.doc
  3. On El Capitan you have to add the texbin utilities to your PATH: export PATH=/Library/TeX/texbin:"$PATH"
  4. Convert: pandoc -o myfile.pdf myfile.docx

Because your question was regarding batch converting multiple files, you could easily put this into a loop:

#! /bin/bash
for file in *.doc; do
  textutil -convert docx "$file"

  # Account for the new `x` in `docx`
  pandoc -o "${file%doc}pdf" "${file}x"
done
|improve this answer|||||
2

Seems like the Automator solution doesn't work anymore.

So there is a simple one.

Install the CUPS-PDF module for OS X. This is a virtual PDF printer that looks like a "real" printer to the system, but creates a PDF file when you send a document to it.

https://bitbucket.org/codepoet/cups-pdf-for-mac-os-x/wiki/Home

If you make it as your default printer, then you just have to mass select all your files and do "Command" + "P" (shortcut). Mac OSX will open all files, send them to print in pdf, then close them = Simple and it works (on my Mac OS X 10.8.2 Montain Lion)

other tip :

"After you have installed the Virtual Printer using CUPS-PDF, there is a simpler and more powerful way to batch convert any set of documents to PDF files.

Use Printer Setup Utility to create a Desktop Printer icon for the Virtual Printer. After it is created, I put it in my Dock for easy access.

In the Finder, drag your file icons to the Virtual Printer icon. For Microsoft Word documents, Microsoft Word will be opened and instructed to print each document to that printer.

Unlike the Microsoft Word Macro method, you can do this for any other document created by any other program. As necessary, the Finder will open the appropriate application and tell it to print to the Virtual Printer.

There are two mild limitations to this general method.

(1) The files you drag to the printer icon need to be ones that the Mac knows what to do with (i.e. you can double-click to open it in some program on your Mac).

(2) The document's default "Open With" application needs to support the AppleScript command for Print. All well-behaved MacOS X programs do this. NeoOffice for example doesn't, and thus batch converting native NeoOffice documents does not work for this printer icon method."

Source (skip the macro part) : http://hints.macworld.com/article.php?story=20070315023808642

|improve this answer|||||
1

You can use the docx2pdf command line utility to batch convert docx to pdf on macOS (or windows). It uses Microsoft Word's APIs to directly convert to PDF creating a perfect copy. It uses JXA (Javscript for Automation, basically AppleScript in JS) in macOS and win32com in Windows.

pip install docx2pdf
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. https://github.com/AlJohri/docx2pdf

|improve this answer|||||
0

If you install the open source AbiWord, you can batch convert from the terminal command line, e.g.:

for FILE in "*.doc" ; do abiword --to=pdf "$FILE" ; done

|improve this answer|||||
-2

Here is a previous answer that should work for this purpose;

Batch-convert Word-documents to PDF's (free)

|improve this answer|||||
  • Which one? This question is about OS X. – slhck Sep 21 '11 at 13:36
  • Forgot about the "Mac OS X" in the title while answering, so I am not sure which will work with that OS. The Google Docs converter may be the best solution then as it is done online. – CharlieRB Sep 21 '11 at 13:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.