Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

12 Answers

up vote 14 down vote accepted

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.

share|improve this answer
    
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 '09 at 18:37
add comment

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.

share|improve this answer
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 '09 at 23:42
    
excellent program thanx –  Krazy_Kaos Mar 23 '10 at 17:10
    
+1 for ImageMagick, but -2 for suggesting it for the wrong job. JPEG is good for photos, but it is the worst format to use when you have sharp egdes and high contrasts (as you typically have with black text/characters on white background). Also, ImageMagick does not do the conversion work itself, it uses Ghostscript in the background as its "delegate" slave. So doing it with Ghostscript directly gives you more control over the parameters used. And then choose TIFF (not JPEG) as the output format, for chris's sake! –  Kurt Pfeifle May 28 '11 at 14:49
add comment

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.
share|improve this answer
1  
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 '09 at 17:49
2  
+1 for simplicity. Most PDF reader allow you to do this. –  Decio Lira Sep 30 '09 at 17:49
1  
What if your PDF has 10000 pages of images? Do you have to do this 10000 times? –  Guy Oct 1 '09 at 4:51
add comment

As an addition to the other answers:

There's also pdfimages from the XPdf package. It will not convert a whole PDF page to an image, rather it will extract embedded images from a PDF.

This is useful if the PDF contains text and images, and you want only the images. Also, it will extract the images in their original format, so no loss of quality is involveld (unlike programs which render the whole page and then convert it to e.g. JPEG). Depending on your needs this might be useful.

share|improve this answer
add comment

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

share|improve this answer
    
note that this will install two different tools on your system. The main one being PDFill Editor, which is the one you don't need. Go into start menu to open this one. I was saved by the screenshot realizing that something was wrong before I uninstalled. –  ufotds May 7 '11 at 19:59
    
Yes, I guess I failed to mention that it also installs a shareware version of PDFill Editor, as well as a PDF printer. Any files created with PDFill Editor will have a watermark unless you buy the editor for $19.99, but the PDFill PDF Tools Free utility doesn't require any purchase. In the version I have, you can't uninstall PDFill Editor without also uninstalling PDFill PDF Tools Free, but having PDFill Editor installed doesn't harm anything. –  rob May 9 '11 at 18:08
add comment

Except for the answer mentioning pdfimages, all of the other answers fail to mention that their solutions actually transcode the embedded images. I.e., those solutions do not simply extract the original image, but modify it, possibly to the detriment of the image, during the process. Only pdfimages extracts the original image. This is true of Ghostscript, Imagemagick, Adobe Reader, PDFFill, PDF Xchange Viewer, OS X Preview, and most other PDF software.

share|improve this answer
add comment

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
share|improve this answer
add comment

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

alt text

share|improve this answer
add comment

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)

share|improve this answer
    
Just tried and it gave this error message "Sorry! This image could not be converted correctly." –  Guy Oct 1 '09 at 4:54
add comment

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.

share|improve this answer
add comment

(Non-free) Acrobat professional does this:

Advanced->Document Processing->Export all images...

share|improve this answer
add comment

You can check out this article.

It lists out 6 different ways to convert the pdf into images.

Convert PDF to JPG (The Web Way)

PDF to JPG Converters for The Desktop

share|improve this answer
    
erm.. Why downvoted? –  noob Apr 16 '13 at 6:10
add comment

protected by nhinkle Oct 1 '12 at 0:37

Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.

Would you like to answer one of these unanswered questions instead?

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