Page 1 of 1

Convert with density and resample arguments does not change DPI

Posted: 2019-09-28T02:39:21-07:00
by blumbergrotem
Hello, Colleagues,
I am trying to convert a pdf to a 300 DPI image, I specify the arguments:
-units PixelsPerInch -density 300 (also tried -units PixelsPerInch -resample 300)

But when checking DPI using identity I get 72 DPI.

Here is the convert command:

"& 'PathToIMageMagickFolder\magick.exe' convert 'PathToFolderContainingFile\fileName.pdf' -units PixelsPerInch -density 300 'PathToFolderForExportedImage\fileName.pdf'"

Than I run the identity DPI check:
"& 'PathToIMageMagickFolder \magick.exe' identify -quiet -format "%x x %y" 'PathToFolderForExportedImage\fileName.pdf'"

And get:
72 x 72 - 72 x 72 - [DBG] (by the way why does it appear twice with DBG? I did not specify any debug parameter)

I also tried with -resample with the same result.

Your help is highly appreciated,
Rotem

Re: Convert with density and resample arguments does not change DPI

Posted: 2019-09-28T04:49:30-07:00
by snibgo
"-format" is done once per image, so I suppose your PDF has two pages.

PDF pages are vector, so they don't really have any resolution. However they do have a physical size in inches or whatever, so setting a density for a PDF affects this size.