Converting a PDF to a series of images.

Today I needed to convert a PDF file to a series of images. Initially I was a little stumped on how to do this easily on my Mac.

My first port of call was Preview. Preview is one of Mac OS X’s most useful tools, but for this task it let me down.

You can use Preview to save a PDF file to a variety of other image formats just by choosing “Save As…” from the File menu. Preview will then ask you to specify a format and other image options. Unfortunately when you choose to save in the PNG image file format, this saves just the current page you are viewing. What I wanted was each page of the entire PDF to be saved to a separate file.

My next thought was perhaps I could use AppleScript to automate Preview. Unfortunately Preview is one of the few Apple tools that doesn’t support AppleScript very well (if at all).

Render PDF Pages as Images Automator workflow

This lead me to think about Apple’s Automator tool, and I discovered that Automator has an action called “Render PDF Pages as Images”. Hurrah! Problem solved! Well, not quite. I’m not an Automator expert so I had a little trouble figuring out how to use it. In the end I constructed the following workflow.

  1. Render PDF Pages as Images
  2. Rename Finder Items (set to Make Sequential mode)
  3. Move Finder Items
  4. Reveal Finder Items

When I was creating this workflow I was concerned about there not being any way to specify which folder to save the images into and other options on each workflow step.  However I then discovered the “Show this action when the workflow runs” check box in the options section of each action.  When this checkbox is enabled the action will pop up a dialog and ask the user to specify certain options.  In the case of the Render Pages as Images action you can specify the image format and DPI settings.  For the Move Finder Items action you can specify the destination directory.

I saved this workflow as an “Application” and now I have an icon I can drag a PDF onto to create a series of images.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s