I've been searching around for a while and still can't find a way to use imagick to convert a pdf file to a png file with good original quality.
I'm in need of converting pdf documents containing text as well as images to png files, in such a way that image/text is sharp and clear. Is there a way to do this within imagick?
All my attempts so far have been less than fruitful.
PDF to PNG conversion with good quality.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PDF to PNG conversion with good quality.
Use supersampling technique. Increase the density, then resize by the inverse of the density increase.
convert -density 288 image.pdf -resize 25% output.png
normal density is 72. So 72*4=288. Thus resize is 1/4=25%
convert -density 288 image.pdf -resize 25% output.png
normal density is 72. So 72*4=288. Thus resize is 1/4=25%
Re: PDF to PNG conversion with good quality.
But what about with the imagick extension? I really don't know how to work my way around that extension...
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: PDF to PNG conversion with good quality.
h2shin wrote:But what about with the imagick extension? I really don't know how to work my way around that extension...
Sorry you will need to find the equivalent operations in Imagick. I am not an expert on Imagick. But see http://php.net/manual/en/book.imagick.php and resizeImage() and setImageResolution()