如何在PHP中使用谷歌文档查看器或其他应用程序将PDF转换为位图


How to convert PDF to bitmap with google docs viewer or other application, in PHP

我有一个带有pdf文件的网址,我需要它转换为jpeg或png。任何人都可以帮我解决这个问题吗?我为我的网站使用 php,我需要这个功能。

使用 imagemagick http://www.imagemagick.org/script/index。

$url = "" ; //URl to document ;
$tmp = tmpfile() . ".pdf";
file_put_contents($tmp, file_get_contents($url));
exec("convert -density 300 $tmp image.jpg");
相关文章: