Page 1 of 1

pdf2png

Posted: 2009-10-09T02:31:29-07:00
by crealing
i got a trouble when i converted pdf to png. if the pdf have transparency layer, the generating png is very bad, and the transparency area show black box. can anybody tell me how to resolve it.

php codes i used as following:
1.exec('convert input.pdf out.png');
2.exec('convert -resample 72 -thumbnail 300 input.pdf out.png);

Re: pdf2png

Posted: 2009-10-09T10:13:18-07:00
by fmw42
I am not sure I know how to help with transparency. As I recall that issue came up recently and was fixed. So if you are on an old version of IM, the best thing would be to upgrade.

With regard to quality, the best thing is to supersample

convert -density 288 input.pdf -resize 25% output.png

or

convert -density 288 input.pdf -thumbnail 25% output.png

Note 288=4*72 where 72 is the nominal dpi

So you would be reading in the pdf at 4x resolution and using -resize to downsample by 4x