Imagemagick: Pdf to bitmap density quirk

Posted on September 24, 2009

0


When converting bitmapcontained pdfs to bitmaps using the imagemagick convert method, beware the parameter order! The density parameter sets the resolution of the bitmap conversion before resizing – therefore, the higher density value, the better resulting quality.
So, the followning should work, but doesnt:

convert source.pdf -resize 630×891 -density 300 result%04d.png

By some reason the -density parameter has to be set before the source file name. This works:

convert -resize 630×891 -density 300 source.pdf result%04d.png

By the way, the “%04d” tag in the resulting file name gives an autonumbering with leading zeros, in this case 4 digits in total. Thus:

page0000.png
page0001.png
page0002.png

etc.

Advertisements
Tagged: ,
Posted in: Uncategorized