开发者

PHP imagemagick exec convert PDF page 0 to PNG is too small

I'm using this to convert a PDF to PNG:

exec('/usr/bin/convert -density 96 -quality 85 a.pdf[0] a.png');

I have also tried to make it as simple as this:

exec('/usr/bin/con开发者_StackOverflowvert -colorspace RGB "a.pdf[0]" "a.png"');

but the source PDF file I gave has only one image and no text, and that image is 700x400 px size and still, the PNG that results is small as 100x30 for example.

How can I convert in order to result the original sized image? Am I doing something wrong?


Try to use this params for convert "-density 300x300 -units pixelsperinch". What about it?


I ended up using the command along with "-density 350%" parameter. This gave me the exact picture size every time and has worked so far.

exec('/usr/bin/convert -density 350% -quality 85 a.pdf[0] a.png');

Thanks for you time.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜