How to Easily Convert a DOCX File to PDF in Mac OS X

How to Convert a DOCX File to a PDF File on Your Mac

If you have used Microsoft Word or received any Word documents from your friends/colleagues, you are familiar with the .docx format. It is the default file extension for any document created in Microsoft Word.

If you happen to have a number of .docx files in your Mac and would like people to only have read access to them, the best way is to convert them to PDF format so others can access them without having to install an office suite.

While there are multiple ways to convert a DOCX file to PDF, the most convenient and fastest way is described below. The reason I call it the fastest way is because it only requires right-clicking on the DOCX  file.

You are going to create an Automator script that will handle the DOCX to PDF conversion for you.

1. Launch Automator on your Mac by clicking on Launchpad in your Dock and searching for “Automator.”

docxtopdf-automator

2. When Automator launches, select the “Applications” folder as the location for saving your script, and click on “New Document.”

docxtopdf-new

3. On the following screen select “Service” as the document type, and click on “Choose” to create a new document that is a service.

docxtopdf-service

4. You are ready to create your script. First, select “files or folders” from the “Service receives selected” drop-down menu, and then select “Finder” from the “in” drop-down menu.

docxtopdf-dropdown

5. Now, drag and drop the action labeled as “Get Specified Finder Items” from the left-panel over to the workflow that is on the right.

docxtopdf-get

6. Drag and drop an action named “Run Shell Script” from the left-panel onto the right-panel that is called workflow.

docxtopdf-shell

7. Focus on the Run Shell Script action in the workflow, and click on the drop-down menu labeled as “Pass input” and change it to “as arguments.”

docxtopdf-arguments

8. Here comes the main part of the procedure. You need to copy the following script and paste it into the Run Shell Script box on your workflow. This is the script that actually does the process of converting a DOCX file to PDF.

docxtopdf-script

Note: the script above does not remove the original .docx file. You can uncomment (by removing the “#” in front of the line) the # rm "$f" >/dev/null line to have the original file removed after conversion.

9. Your script is ready, and you need to save it by clicking on the “File” menu followed by “Save…”

docxtopdf-save

10. Enter a name for your service, and click on “Save.” You should enter a meaningful name. I have named it “Convert to PDF” as it is self-explanatory.

docxtopdf-name

11. Now that your service is ready to do a conversion, let’s try it on a DOCX file to see if it works.

To perform a conversion, find a DOCX file, right-click on it and select “Services” followed by “Convert to PDF.”

docxtopdf-convert

12. Within a few seconds you should see the output PDF file in the same directory as the original file. You can now access this PDF file using any PDF reader such as Preview.

docxtopdf-pdf

If you have a bunch of DOCX files on your Mac and wish to convert them to PDF but do not want to go through all the hassle, you can use the above method that only requires a right-click on the file to convert it to PDF.

22 comments

  1. OR use can just save as and select PDF. Mr. Mahesh Makvana seems like a little overkill to reinvent the wheel.

    • Hi there,

      Thanks for your tip but the method that I’ve described here lets you convert a document by just right-clicking on it (yours requires opening an office suite and clicking on File menu and then selecting Save as and then choosing the file name and so on).

      Thanks for the comment, though!

    • Looks like slum dog’s reinvented wheels are hexagons. The whole point is to circumvent the opening of the file. Like comparing apples and lemons.

      I do have one small problem though, with which you can hopefully help me out, Mahesh. The whole script seems to remove my text formatting. For example the file I have to make a PDF of is always one pag with a title in a box. The box is nowhere to be found after using your method. It is however the closest I got to finding something that does what I need it to do. Thanks for that.

  2. Libre Office will convert it quicker and simpler. Just open the .docx file with LO, then export it as a .pdf.

    Done

    • Ok, so would that method be as easy as right-clicking on the file and being able to convert it to PDF?

  3. Right click on document, then left click to open and right click on the export to PDF .
    That is it in a nut shell. Three steps in Libre Office.

    • Yes, you need to go through all of those steps (and you do need to download the Libre Office suite), but the above method only requires one time script creation and then you’re all set to convert as many documents to PDF as you want with a right-click.

      The above method doesn’t even require you to have an office suite installed on your computer; making the task even more easier.

      • ChiefH: If it’s just one file, sure… open it in the native app and then save as. But if I have a folder with 35 docx files that I need to convert to pdf, then that would take far too long. However, I still have the problem others do: the formatting of the original is lost.

  4. But I already have Libre Office downloaded and up to date, it actually came with my OS so no separate download was necessary. I would expect that anyone that wants to convert a .docx file to a .pdf file would have an office suite installed on their computer, other wise why would they be fooling with converting office type files?
    Why fool with a script when it is all there in an application?

    • Hi there,

      While Libre Office and such other office suites do help you convert a document to PDF, wouldn’t it be great if the same job could be done by just right-clicking on a document?

      This guide’s been written keeping the Mac users in mind and they may or may not have Microsoft Word installed on their machines, and they’ll most likely not install this office suite only to convert a document to PDF.

      In my opinion, the method described in this guide is really great and the fastest way for converting a document to PDF.

      Thanks for your comment, though!

  5. Thanks Mahesh for the excellent description of extending the actions menu. This is really a very fast method to convert a docx into pdf. I especially like that it needs only a few more lines to the script to e.g. Convert a folder with many docx-files at once. None of the methods, described by the other commenters does offer this flexibility.

    • Glad that you found this guide to be useful and convenient for converting DOCX to PDF.

      Thanks for your kind words :)

  6. Wow! Thanks for the really nice tip! A real time-saver for me, as I have neither Microsoft nor Libre Office installed on my Mac.

    • Yes, this is definitely a great way for converting DOCX to PDF for those of us who haven’t got an office suite installed on our machines.

      Thanks for your comment and keep coming back for more!

  7. I Love how immeasurably stupid some people are…

    e.g. “Just open the .docx file with LO”… right, cause if I need to convert 3000 files opening a application 3000x times is WAYYYY faster then simply right clicking a group of 3000 files.

    Isaac2k clearly demonstrates from his comments that he understands whats going on, and as PWS442 mentions, this works even if programs like word or LO are not installed at all.

    great tip,
    Keep up the excellent work

    • Hi A S,

      While there are other ways to convert DOCX to PDF, I find this to be the most convenient way as all it requires is a right-click on a file and you’re all set.

      Thanks for stopping by and leaving us a comment.

  8. Mahesh:
    this is a huge help and a perfectly detailed step by step on how to do it.
    the only issue i’m having some trouble with is that it’s converting a 1 pg DOCX file into a 2 pg PDF.
    Is that an issue with the script or is there a way to fix that?

    thx

  9. For me, this creates a .pdf with the right file name, but when I open it, the file contains blank pages. Any idea why?

  10. Rectification: This script automatically converts DOCX -> HTML -> PDF. This is not the best methode because the HTML step could cause lay-out issues. Compare is as .GIF -> MP4 -> .JPG … it works, but it’s stupid :D

  11. Great tip,

    some guys in the comment board don’t get the convenience part of the solution

  12. Hi, works great!
    1 question though. I’d like to do the same for microsft excel files on mac.
    I tried it with this script, but it didn’t work…
    Would you have a script for excel too?
    Thanks in advance…

  13. When I use this, it strips the formatting and comments out. How I preserve it? I basically want the “Save to PDF” option in the print dialogue.

Comments are closed.

Sponsored Stories