How to convert PDF to image

You may sometimes want to convert a PDF file into an image format like PNG or JPG. Doing this is easy using the convert application from ImageMagick.

If you do not have it, first install ImageMagick:

$ sudo apt install imagemagick

To convert a PDF with a single page into a JPG:

$ convert foo.pdf foo.jpg
$ ls

If the PDF has multiple pages, one image file is produced per page:

$ convert foo.pdf foo.png
$ ls

By default, the image file is produced at 96 DPI resolution of the PDF. If you need higher DPI, use the density option. For example, to generate at 300 DPI:

$ convert -density 300 foo.pdf foo.png

Note: The -density parameter has to come first. If you place it anywhere else, the program runs silently without complaining, but the output image will be in the default DPI.

Tried with: ImageMagick 6.7.7-10 and Ubuntu 14.04


2 thoughts on “How to convert PDF to image

  1. Hi,

    The above solution is nice but it only for those user who understands the scripts or have the knowledge of scripts. So here i can suggest you another solution that i had try to images to PDF it is named as PDFWARE……………


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.