Convert PDF to JPEG on OS X

I had a student of mine complain that the .PDF material I’d provided was illegible. I attributed the problem to her ignorance, and to her lack of knowledge of the magnification tool, but the customer is always right, … right? So, I decided to hard copy the material myself and personally hand it in to her at our next class a week away. In the meantime I wanted to convert the .PDF material to something that she may have been more adept at using, even if in a rastorized format. So, I decided to convert the .PDF to –wait for it– .JPGs!

Googling brought me to an article that details a script that converts .PDF to .JPG but –in true mac fashion– it only works with the latest and greatest pay-ware version of OS X, 10.5, while I use 10.4 –leaving murmurers such as myself lost in the wilderness as the faithful continue to the promised land with their glorious and fearless leader, Jobs.

Now, my problem is not with converting .PDF to .JPEG. I think this should easily be possible considering both formats are so pervasive. My problem is that it would seem –according to the Machead in the article previously mentioned– to necessitate underlying technology which only works with 10.5 OS X, and if there are other options for 10.4 users, why not mention them? Well, I found out there are other options, two –of which I’m now aware– in fact.

Using pdfsam and MakeJpeg

Frustrated at the lack of 10.4 support and determined to find a free (or Libre) workaround –even if it involved more than one procedure or program– I soon found out that there is a sips command that converts .PDF to .JPG, but that it only produces single page .PDF documents and, when dealing with a multi-page .PDF document, only accepts the first page. To this end, there is a convenient droplet that uses the sip command called MakeJpeg, but the first page problem remained. Well, I’d forgotten that there is a Libre program called pdfsam that splits up a .PDF document into individual .PDF pages, which MakeJpeg can subsequently convert to the desired end-product.

Note: if your source files are searchable, they will continue to be so as long as they remain PDF files. JPG files aren’t so.

Using Automator

There is a second way to do this that escaped me. And that is to use (I say the following in an “Arnold” tone of voice) “the Automator”. With this method, once you have the script made, it’ll be a one step droplet process of dragging and dropping onto the application script. You need to create it yourself, and it isn’t difficult at all.

Note: this method creates non-searchable image files.

The Automator application will have two sections. (The second really being optional.)

  • First, open Automator up and under “PDF” (on the left hand side) select “Render PDF Pages as Images” as process number one. Make sure that the “JPEG image” format is selected. Configure options to your liking.
  • Second, select “Preview” (again, located on the left hand column) and select “Open Images in Preview”. That is, if you want to see a preview of said JPEGs.
  • Proceed to save the script, by naming it (something such as, “pdf2jpeg”), saving it as an application, and then use it as you would a droplet.

Now when using the Automator application (with both processes as suggested above), Preview will pop up and display the JPEG files during the procedure, so if you’re not adept at using the terminal cp command, just use the “Save as” feature from within Preview for each JPEG image and specify location of where you want to save a permanent copy, but –depending on the amount of images– this might be too repetitive. Otherwise, you could just copy them (and their containing folder [“/private/temp”]) to, say, your Pictures folder with a terminal command such as,

cp -r /private/tmp ~/Pictures

Maurice Cepeda

All rights reserved on the article, defined as the text and any original material and medium –including photographs when specifically mentioned in at least one of the following corresponding elements: caption, alternate text, or title. Quoted texts, and other material not copyrighted by Maurice Cepeda, are used under the concept of fair use and are the properties of their respective owners –including photographs, audio recordings, videos, or any other products in any form or fashion– as are all brands mentioned. If copyrighted videos and/or audio recordings should make themselves into articles, note that they are not hosted herein; if you are the copyright holder of any such material (and have a problem with fair use), approach the appropriate hosting site. Any audio or visual material (or any combination thereof) incorporated under fair use, either hosted locally (if that should come to be) or otherwise, will most likely be of lesser quality, thus, “fair use”. By reading this article, the reader forgoes any accountability of the writer. The reading of this article implies acceptance of the above stipulations.

Advertisements

12 thoughts on “Convert PDF to JPEG on OS X

  1. Thanks for the details.

    I’ve since discovered that Preview will print jpegs or tiffs to either iPhoto or a folder, which seems to work quite well. I believe it also uses an Automator flow.

    john

  2. Thanks. Off of the top of my head, there is a caveat to your way (including my Automator way) and it’s that it creates non-searchable image files while the other way conserves them as searchable PDFs (if they started out this way). That’s something I’ve been meaning to add onto the above article. There are significant size differences in the final products –if I recall, too.

    Personally, I like to keep searchable files searchable.

  3. I’m using an Automator script like this from within Aperture 2 on Mac OS-X 10.5 but I have a slight problem. I’m printing a photo book and using the Print PDF to JPG files automator but what I get are JPG’s in the archaic generic RGB profile. I need either Adobe RGB or sRGB, but generic RGB is a useless profile. Anyway to change this?

  4. Gimp for OS X? Apparently, gimp supports sRGB with a patch. See http://www.gimpusers.com/forums/gimp-developer/12426-GIMP-distributing-sRGB-profiles-license-issues.html . There’s various X11 ports. There also used to be a simplified watered down Aqua port called Seashore. Maybe you could automate (apple script) Seashore allowing batch handling if Seashore supports sRGB and scripting.

    Oops. Embedding the profile is another story. From the looks of things, the above supports only reading. And a quick glance at the thread shows that they’re still fighting it out about whether to embed or not.

    Still there used to be an OS X photo handler –a jack of all trades, a Swiss army knife. Oh yes, GraphicConverter. It does apple scripts and batch converting and from the looks of things, saves sRGB profiles (stores sRGB chunks to PNGs).

    It’s not OSS but was very popular years back in my arsenal before I used gimp. Maybe that could help if you could print straight from PNG files with the correct colour profiles embedded. Hope that helps. No guarantees, though.

  5. I’m also noticing that ColorSync Utility, Core Image Fun House and Preview all seem to support two Adobe RGB profiles as well as sRGB. I first noticed a set of Apple Scripts I’ve had for years (called ColorSync) supports it.

    The best of luck with that!

  6. The last part is terribly complicated.
    As a second item, just add a “Copy Finder Items” and set a destination.

  7. To convert PDF TO OTHER FORMATS

    A) OPEN AND LAUNCH A PAGE OF SAFARI or other browser
    B) PASTE YOUR FILE PDF IN THE PAGE
    C) CHOOSE PRINT
    D) HERE CHOOSE PREVIEW
    E) SAVE YOUR FILE ACCORDING TO THE ORMAT YOU WANT (THER A LOT OF FORMATS)

    • Thanks for contributing Pierre. More people should follow your example.

      The only issue I have with your method is that it only saves one page at a time (with multipage PDF documents), the same problem MakeJpeg has (and the reason for using pdfsam or the Automator script application I mentioned).

  8. Methods that you’ve mentioned were quite straightforward and very useful that I immediately find way to use it. I’ve converted several pdf to jpegs in no time. I was desperately looking for methods to do so since I can’t view pdf documents on my phone. But luckily with enough resolution, viewing it as a jpg file looks very promising!

    Thanks for this awesome post and definitely would check back for more of these.

    Regards,
    Steve

  9. Oh! That’s great!

    I just found out that there is no need to save each image via Preview,
    you just need to use Move Finder Items instead and choose a folder you like to save to.
    Thanks a lot!

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s