3

I would like to extract pdf pages as png files to be manipulated in a image viewing module that I am writing. I originally used the ConvertPDF wrapper for ghostscript but it seems to be having trouble with multipage pdfs.

Update: It seemed like all roads ended up back at GS so I stuck with ConvertPDF.

Kevin
  • 4,567
  • 1
  • 28
  • 36

1 Answers1

4

Easiest to use ImageMagick for that purpose, again a Ghostscript wrapper in the case of PDFs.

Either the command line can be used, or one of the wrapper libraries.

An example command line could be.

convert -density 300 mydocument.pdf[2] page-3.png

(Important to state image density (DPI) on PDF reads)

Orbling
  • 20,413
  • 3
  • 53
  • 64
  • Note, if you end up using the [ImageMagick.Net wrapper](http://imagemagick.codeplex.com/), then [this question](http://stackoverflow.com/questions/2916555/converting-pdf-to-images-using-imagemagick-net-how-to-set-the-dpi) might be of use regarding density. – Orbling Apr 27 '11 at 15:11