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

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
kai4711

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

Post 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
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post by magick »

Move the density option before your image filename.
kai4711

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

Post 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
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

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

Post 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!
kai4711

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

Post 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...
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
Post Reply