convert a multi page pdf to a single image
rene — Mon, 07/12/2010 - 15:08
Task at hand was to convert a 110 page PDF to an image format. JPEG or PNG would do. Solution was to use the powerful convert command from the imagemagick suite of tools. Here is how.
First install imagemagick
Next convert your PDF to JPEG (1 PDF page per JPEG image) using %04d with the destination filename which will force convert to create filenames that contain 4 decimals with leading 0's counting upwards from 0 (eg; document_0000,jpg, document_0001.jpg, document_0002.jpg)
Finally use convert to append all JPEG images into a single image.
If you get an error with the amount of pixels the final JPEG image contains, you will need to use another image format. JPEG only allows a maximum of 65500 pixels for width or height.
convert: Maximum supported image dimension is 65500 pixels `document.jpg' @ jpeg.c/EmitMessage/232.
Try using GIF or PNG if you do get this error though do keep in mind these are
lossless image formats so the filesize of the final image can be quite large.
































