Page 1 of 1

PDF -> Jpg Bad results

Posted: 2008-05-21T05:34:18-07:00
by PCPete
I tried this with the Com object first, but have been working strait through the command line and can not get a clean conversion from PDF - Jpg. I create a 300dpi, 500x500 red square with "TEST" in white letters across it, in photoshop. I saved this as a flattened PDF with no compression.

Code: Select all

-convert -quality 100 test.pdf test.jpg
Creates the jpg but it looks terrible. Wrong size, wrong dpi, terrible quality. I read something about how a pdf is really resolution independent, that probably factors into this. But no amount of -resample or -resize fixes the image. Is there anything I can do to correctly output the size and resolution, or at least correct the quality?

Re: PDF -> Jpg Bad results

Posted: 2008-05-21T06:15:06-07:00
by magick
Try this command:
  • convert -density 400 test.pdf -resize 25% -quality 100 test.jpg

Re: PDF -> Jpg Bad results

Posted: 2008-05-21T06:26:35-07:00
by PCPete
I modified your command a little (there always seems to be a slight difference when working in ASP than from the command line) and came up with

objIM.convert("-density","300","-depth","100",imgPath, Server.MapPath("display/new_rgb.jpg"))

And it works perfectly. thank you!