38

How do I convert a multi-page PDF file to PNG files, and automatically save one PNG file per page of the PDF document (for Windows 7)?

I have tried virtual printers (CutePDF, Bullzip PDF Printer) and image editing software (Irfanview, Photoshop) to convert PDF files to PNG but I can't find a way to make them save one PNG file per page of a PDF document.

6 Answers6

35

Using ImageMagick (you'll need Ghostscript installed as well), the command:

convert -density 300 filename.pdf filename.png

will result in a series of files filename-0.png, filename-1.png, filename-2.png, one for each of the pages of the PDF. You'll want to play around with the density setting to get a resolution you like.

You may need to give the full path to convert.exe on Windows; I've only ever done this on Linux, but it should work for Windows too.

phuclv
  • 30,396
  • 15
  • 136
  • 260
frabjous
  • 11,333
24

Use Ghostscript

-sOutputFile=filename This is a general option telling Ghostscript what to name the output. It can either be a single filename 'tiger.png' or a template 'figure-%03d.jpg' where the %03d is replaced by the page number.

You may find it convenient to use GhostView, the GUI front end.

4

You can use PDF-XChange. It can export any pages you want to the expected format. Not only PNGs but many other formats are supported too

Export images dialog

Export menu

phuclv
  • 30,396
  • 15
  • 136
  • 260
3

If you prefer not to install any software, you can use this online tool:

convert.town/pdf-to-png

The conversion is done inside your browser. It will produce one PNG file for each PDF page.

sunset
  • 319
2

Another software to do the conversion is PDFCreator. It'll create a new printer in your system so you can actually convert from any formats to images, not only PDF files

  • Convert your documents to PDF, JPG, PNG, TIF and more
  • Merge multiple documents to one file
  • Profiles make frequently used settings available with one click
  • Use automatic saving to have a fully automated PDF printer
  • We take care of the complexity and make converting PDFs simple for you

More importantly it's also open-sourced

Just print the document, select the PDFCreator and choose the output as PNG (or TIFF, JPG, whatever...) and you're done

PDFCreator screenshot

phuclv
  • 30,396
  • 15
  • 136
  • 260
2

This is an example with GS with the CropBox option:

"c:\Program Files\gs\gs9.10\bin\gswin64.exe" -dBATCH -dNOPAUSE -sDEVICE=pnggray -r300 -dUseCropBox -sOutputFile="path_to_png_files\pdffilename-%03d.png" "path_to_pdf_file\pdffilename.pdf"

The path to GS should be adjusted based on your installation. Also, the DEVICE parameter could be changed to a color device if required. Compared to convert, GS seems to run much faster, and it is more suitable for big batches of conversion.

imriss
  • 387