Applescript: Easily convert PDF documents to JPG or PNG

There are, of course, a million ways to convert PDF documents to JPG or PNG files. However, sometimes you just want something quick and easy.

A while ago, reader AS pointed me out an Applescript droplet written by Martin Michel over at MacScripter.

AS mentioned that it would be nice to have a version that converts to PNG as well. Being nothing if not nice, I used my almost non-existant Applescript/Python skills to convert Martin’s script to output PNG. All credit for this goes to Martin.. I just did some modifications.

Here’s how to do it:

PDF To JPG

PDF to PNG

  • Download PDF2PNG from here
  • Drag a PDF or multiple PDFs onto the icon
  • Select the resolution (or accept the default)
  • A PNG file will be created for each page in the PDF

Hope this helps some of you. I know they will come in handy for me. Thanks AS and thanks Martin Michel! Let me know how it works out for you.



Related posts:

  1. Use Acrobat Batch Processing To OCR Your PDFs Easily
  2. Acrobat Applescript For ScanSnap OCR
  3. Found: ScanSnap Applescript to remove ABBYY FineReader file
  4. Using Mac OSX Preview To Password Protect Your Documents
  5. Using The Mac Preview App To Manage Documents

Tags: ,

10 Responses to “Applescript: Easily convert PDF documents to JPG or PNG”

  1. Nick May 6, 2010 at 4:08 am #

    Thanks, you just saved an hour of my time!

    • BrooksD May 6, 2010 at 4:19 am #

      No worries Nick glad it helped!

  2. Sofia May 10, 2010 at 3:03 pm #

    It asks me to select a resolution, but no matter what I choose (e.g. 150 dpi) it converts to 72 dpi.

    • BrooksD May 10, 2010 at 3:26 pm #

      Hi Sofia, which one? PDF -> JPG or PDF -> PNG?

  3. Phil May 20, 2010 at 9:03 am #

    Hi BrooksD,

    Just wondering if you have any idea how to easily change the droplet into a folder action.
    Obviously the dpi would have to be manually set within the script but I can't figure out how to turn the droplet into a folder action, any ideas?

    Thanks in advance,

    Phil

    • BrooksD May 20, 2010 at 1:27 pm #

      Hi Phil, I think that should be doable. Let me play and get back to you.

    • BrooksD May 21, 2010 at 2:04 am #

      Hi Phil, OK give this a try:http://www.documentsnap.com/files/pdf2png-action….

      Since you're asking for a folder action I'm guessing you know what to do with it, but let me know if you're not sure. This should give you something to go on if you want to convert the macscripter one too.

  4. MD September 17, 2010 at 7:02 am #

    I like the way your script processes multiple pages. Would it be possible for you to share the code so that I could convert it in to a bash script where parameters could be passed to convert files and used as an automation too for many who need it.

    • MacD September 17, 2010 at 6:37 am #

      Ignore my previous post. I do see that you have the code in there. One thing. Even when passing a resolution in the case of PDF2PNG it converts to 72 dpi. The .py file has a hardcode value. You may want to change that.

      • BrooksD September 17, 2010 at 7:37 am #

        Thanks MacD, I'll check it out!

Leave a Reply