您好,欢迎访问一九零五行业门户网

php pdf文件转图片

为什么会文件读取不到,路径 pdf文件权限都已设置
$pdf = './22.pdf';$im =new imagick(); $im->setresolution(120,120); $im->setcompressionquality(100); $im->readimage($pdf); foreach($im as $key => $var){ $var->setimageformat('png'); $filename = './'.md5($key.time()).'.png'; if($var->writeimage($filename)==true){ $return[]= $filename; } }

报错内容:fatal error: uncaught exception 'imagickexception' with message 'failed to read the file' in
回复内容: 为什么会文件读取不到,路径 pdf文件权限都已设置
$pdf = './22.pdf';$im =new imagick(); $im->setresolution(120,120); $im->setcompressionquality(100); $im->readimage($pdf); foreach($im as $key => $var){ $var->setimageformat('png'); $filename = './'.md5($key.time()).'.png'; if($var->writeimage($filename)==true){ $return[]= $filename; } }

报错内容:fatal error: uncaught exception 'imagickexception' with message 'failed to read the file' in
$pdf使用绝对路径呢
try { // read img} catch (imagickexception $e) { echo exception;}
其它类似信息

推荐信息