Convert a PDF file into a single Image using ImageMagick
Don't know when you might feel the necessity to convert a pdf into a .jpg or a .png file
, but in case you have to, then ImageMagick will make this job really easy for you. ImageMagick is a great opensource command line utility for image manipulation.
Since, we are dealing with image conversion we will use the "convert" script, provided by ImageMagick.
[shredder12]$ convert file.pdf image.png
If the pdf file(file.pdf) has only one page then a single image.png file will be formed. In case of multiple pages, same number of image-[n].png files will be produced. For example, a three page pdf will result into three image files - image-0.png, image-1.png and image-2.png.
If you want to combine/stitch all these images together to form a single one, something similar to taking a snapshot of the whole pdf, then just run the following command.
[shredder12]$ convert image-* -append single_image.png
This will result in a single image file.



























6 Comments
Hi Richard, thanks for this great advice. I haven't dealt with such conversions often so am not aware of various options convert provides, but this will certainly be helpful to a lot of users with similar issues.
Post new comment