Page 1 of 1

PDF to Image converstion problem

Posted: 2012-05-09T11:00:58-07:00
by pertinentobserver
Hi,

I have to write a windows command line shell script to convert pdf to Images. For the following sample command:
convert.exe -density 300x300 -resize 3508x <file>.pdf -units PixelsPerInch -profile srgb.icc <FILE>.jpg

This command works fine for pdfs with NON-White background but goes wrong with pdfs with WHITE background. Any idea how I can give a command that works for both?
Plus
1) If the PDF is converted to .png ( as opposed to .jpg). It works. Any idea why?

Re: PDF to Image converstion problem

Posted: 2012-05-09T13:08:49-07:00
by fmw42
you will need to post a link to one of your pdf files. you probably need to flatten it against some background as your pdf may have transparency. also you syntax is probably not correct for IM 6 though it probably won't matter at this time. The resize should be after you read the pdf. if your pdf is cmyk, then you probably need to put -colorspace sRGB before the input image

try

convert.exe -density 300x300 <file>.pdf -resize 3508x -units PixelsPerInch -profile srgb.icc -background white -flatten <FILE>.jpg

but better to post a link to your image, so we can see what is happening.