vote up 3 vote down star

I have a PDF that contains a scan image of a document. I want to save the contents of this PDF as an image so that I can then run it through an OCR program that only accepts .jpg, .png, and .gif type files.

How do I save/convert this PDF to one of those image formats?

EDIT: One way I've found to do this is to click on each page. Copy to clipboard. Paste to Paint.net and then save. However, this is cumbersome as it appears you can only select one page at a time in Acrobat Reader.

flag

71% accept rate

9 Answers

vote up 5 vote down check

Use GhostScript. This command works for me:

gs -dBATCH -dNOPAUSE -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 -r150 -sOutputFile=output%d.png input.pdf

There are multiple png pseudo-devices, differentiating on color depth: pngmono, pnggray, png16, png256, png16m, and pngalpha. Choose whichever one suits you the best.

You can also use jpeg, but unless you have a disk space issue, you want as high a quality as you can manage for your OCR, and that's not jpeg.

GhostScript no longer has support for gif, but I can't imagine why you'd need that, what with png256 support.

link|flag
I love GhostScript, and if you want the convenience of a GUI for setting options, viewing, etc try GSview pages.cs.wisc.edu/~ghost/gsview – Dennis Sep 30 at 18:37
vote up 2 vote down

You can do this using adobe reader:

  1. Click the image. It will be highlighted.
  2. Copy (Ctrl-C) and paste it into Paint.
  3. Save as any file type you like.
link|flag
interesting to know, Adobe Reader has a setting to override the dpi of images taken with the snapshot tool, when set to 300dpi, you'll get snapshots that are ready for print (by default the screen resolution is taken, which generally is too low to re-use in other work) – Stijn Sanders Sep 30 at 17:49
+1 for simplicity. Most PDF reader allow you to do this. – Decio Lira Sep 30 at 17:49
What if your PDF has 10000 pages of images? Do you have to do this 10000 times? – Guy Oct 1 at 4:51
vote up 2 vote down

if the image exceeds the size of you screen, you may use FastStone Capture ( a feature "Capture Scrolling Window") and save the image as JPG.

alt text

you can download the free and portable version here.

link|flag
vote up 2 vote down

Install Imagemagick. Open a cmd window or terminal:

convert myfile.pdf myfile.jpg

The output will be 1 jpg file for each page in your pdf, test-0.jpg, test-1.jpg, etc.

link|flag
1  
+1 to ImageMagick. This link also has some easy-to-read hints on getting some specific behaviors (pages, image size, etc.): blog.prashanthellina.com/2008/02/03/… – Chris Farmer Sep 30 at 23:42
vote up 1 vote down

If the file is less than 5MB and you aren't worried about privacy/confidentiality, then is a handy online service at http://www.go2convert.com/ that can do a lot of graphic conversions (including pdf to jpeg)

link|flag
Just tried and it gave this error message "Sorry! This image could not be converted correctly." – Guy Oct 1 at 4:54
vote up 1 vote down

PDFill PDF Tools is probably the easist way to convert your PDFs to images on Windows. It'll let you export all the pages in the PDF to separate images in one shot. It also has a lot of other features available for free, which are only available in other PDF viewers if you purchase the commercial or "Pro" version.

Use the "Convert PDF to Images" button (button #10) in the screenshot below.

PDFill PDF Tools screenshot

If you need to concatenate the images into one very tall image so you only have to feed one file to your OCR program, you can use IrfanView

link|flag
vote up 0 vote down

You could use PDF-to-jpg software

link|flag
vote up 0 vote down

Since you didn't include an OS tag I'll include an OSX answer:

PDFs by default open in Preview.app which allows you to use File -> Save-As:

  • GIF
  • ICNS
  • JPEG
  • JPEG-2000
  • BMP
  • OpenEXR
  • Photoshop
  • PNG
  • TGA
  • TIFF
link|flag
vote up 0 vote down

Also PDF Xchange Viewer (Free) will do export-to-file. File → Export → Export to image.

Not only that, but I think it's the best free PDF viewer for Windows, and it has some nice markup capabilities. I have a license for Adobe Acrobat and I still prefer this unless I'm doing extensive editing, which is rarely.

link|flag

Your Answer

Get an OpenID
or
never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.