Extract full resolution image from PDF using Illustrator and Photoshop

Alec Jacobson

July 12, 2011

weblog/

I had the problem that when kinkos scanned my artwork they gave me a PDF. This doesn't make a whole lot of sense because the scan is a raster image. It'd be much better off in PNG or in many cases JPG. I tried just opening the PDF in Preview or Photoshop and saving as a PNG but when prompted for the resolution I wasn't sure what to put. What was the resolution of the PDF? And what was the resolution of the embedded image? Then I tried opening the PDF in illustrator, selecting the image and pasting it as raw pixels into a new photoshop document. This didn't work either since the image was embedded into the PDF in a scaled form so the copied image was too small. My final solution is as follows:

In illustrator

  1. Select the image object
  2. Open View > Document Info > Embedded Objects
  3. Record the size of the image
  4. Copy the selected image

In Photoshop

  1. Create a new document (this will be the correct dimensions of the copied object, but perhaps the wrong resolution)
  2. Paste the object, but as a Smart Object
  3. Choose Image > Image size...
  4. Enter the size of the image, previously recorded
  5. Choose Layer > Flatten Image
Update: As suggested in the comments it's much easier to use pdfimages to extract embedded images. I made a follow up post which does this then uses imagemagick's mogrify to convert the files to pngs. Update: Also, (see the comments), this is not even the easiest way to a get a single image from a pdf into photoshop.