# How to save an image PDF file as an image

imagespdf

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.

• Please pay close attention to pooryorick's answer, in which he points out how sleske's answer is actually a much better answer for this particular problem.

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.