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);
pdf2png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: pdf2png
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
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