convert PDF to image: smooth text

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
Yulia

convert PDF to image: smooth text

Post by Yulia »

Hi All

I'm trying to convert PDF file to image (jpeg, gif).
Well, the text is a little 'smooth'

original pdf
http://www.inwebdev.com/files/s.pdf

result jpg
http://www.inwebdev.com/files/s1.jpg

I have tryed some commands:

convert -geometry 792x986 -density 96x96 -extract 736X980+48+48 -transparent white -depth 8 s.pdf[0] s1.jpg

convert -density 200x200 -scale 850x11100 s.pdf[0] s1.jpg

convert -density 200x200 -scale 850x11100 s.pdf[0] s1.jpg

geometry 792x986 -density 200x200 -extract 736X980+48+48 s.pdf[0] s1.jpg

convert -scale 850x1100 s.pdf[0] s1.jpg

convert -density 96x96 -scale 850x11100 s.pdf[0] s1.jpg

The result is the same: with 'smooth' text :(

Thanks in advance for any help!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: convert PDF to image: smooth text

Post by anthony »

Increase the density BEFORE reading the postscript, then -resize the result by a simular amount afterwards (or use -resample to also fix the density resolution).

see IM examples postscript text handling
http://www.imagemagick.org/Usage/text/#postscript

Remember do NOT use -scale (which does not smooth images) and do the -resize AFTER reading in the image as IM is a 'do it in the order given' processor.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Yulia

Re: convert PDF to image: smooth text

Post by Yulia »

Anthony, great thanks! :)

This command gives the perfect result:

convert.exe -density 196 s.pdf[0] s.jpg
Post Reply