[Resolved] PDF auto density

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
bzoloid

[Resolved] PDF auto density

Post by bzoloid »

Hi,

I was wondering if there is an option to make imagemagick choose automatically the density when converting a PDF file to a raster format?

For example, if I do this :

Code: Select all

convert -resize 32x32 input.pdf output.png
, the file will be imported with a density of 72 and then eventually resized, which causes an ugly rendering.

Is there a way to adjust the density so that the PDF image is rendered correctly at its desired size? Or should I get the PDF size at 72dpi, then calculate the appropriate density, and then reconvert the image?

Thanks!
Last edited by bzoloid on 2010-08-23T15:23:02-07:00, edited 1 time in total.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: PDF auto density

Post by fmw42 »

IM will not automatically compute an optimal density, to my knowledge. I am not sure that PDF even has a density. The png gets assigned a density of 72 if you don't specify anything for the PDF.

See

http://www.imagemagick.org/Usage/basics/#cmdline

for correct syntax with IM v6

convert -density ... image.pdf -resize ... image.png

also see http://www.imagemagick.org/Usage/formats/#pdf
bzoloid

Re: PDF auto density

Post by bzoloid »

Okay, I will also try to calculate the correct dpi from the PDF size.

I already tested the given examples and the problem is still here.

Thank you :)
Post Reply