Page 1 of 1

Problems converting PDF to Image (jpg, png..)

Posted: 2008-01-16T06:10:00-07:00
by kai4711
Hey Guys,

I am trying to convert a given PDF to an image using ImageMagick (with ghostwriter) (both is installed by my webprovider).

It works but :
  • I get a very unsharp/blurred result.
  • It looks like a very bad PDF-intepreter: diffrent spaces between letters etc.
The PDF: http://flora-apo.info.dd18202.kasserver ... /image.pdf
The created image: http://flora-apo.info.dd18202.kasserver ... /image.png or http://flora-apo.info.dd18202.kasserver ... /image.jpg

The Code:

Code: Select all

convert image.pdf -density 300x300 -trim -append -resize 1400 -quality 100 image.jpg
Is there something wrong/bad with my code, how can i optimize it?
I played around with -density but it doesnt give me a better result...

Thank you in advance,
Kai

Re: Problems converting PDF to Image (jpg, png..)

Posted: 2008-01-16T08:33:51-07:00
by magick
Move the density option before your image filename.

Re: Problems converting PDF to Image (jpg, png..)

Posted: 2008-01-16T09:21:35-07:00
by kai4711
Like this?

Code: Select all

convert image.pdf -append -resize 1400 -quality 100 -density 300x300 image.jpg
No change in "sharpness" and the letter spacing/position...

Thanks,
Kai

Re: Problems converting PDF to Image (jpg, png..)

Posted: 2008-01-16T10:04:21-07:00
by Bonzo
That makes quite a bit of difference with the quality Magick but the letter spacing still goes wrong.

Like this Kai:

Code: Select all

convert -density 300x300 image.pdf -trim -append -resize 1400 -quality 100 image.jpg
First code of Kai:
http:www.rubblewebs.co.uk/TESTS/crop1.png

Secobnd code of Magicks
http:www.rubblewebs.co.uk/TESTS/crop.png

Note: for some reason the post image and URL tags have stopped working for me!

Re: Problems converting PDF to Image (jpg, png..)

Posted: 2008-01-16T13:48:03-07:00
by kai4711
Thank you

that

Code: Select all

convert -density 150x150 image.pdf -append -quality 100 image.jpg
works cool, its really sharper!

But: Please take a look at http://flora-apo.info.dd18202.kasserver ... /image.jpg
How can I get a better solution with the letter spacing etc. Is there something wrong with Ghostscript?

Thanks...

Re: Problems converting PDF to Image (jpg, png..)

Posted: 2008-01-16T13:53:22-07:00
by magick
Now try:
  • convert -density 300x300 image.pdf -resize 50% -append -quality 100 image.jpg
Any letter spacing problems would be with Ghostscript. Try posting to the Ghostscript mailing lists.