Extract full resolution image from PDF using Illustrator and Photoshop
Alec Jacobson
July 12, 2011
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
- Select the image object
- Open View > Document Info > Embedded Objects
- Record the size of the image
- Copy the selected image
In Photoshop
- Create a new document (this will be the correct dimensions of the copied object, but perhaps the wrong resolution)
- Paste the object, but as a Smart Object
- Choose Image > Image size...
- Enter the size of the image, previously recorded
- 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.