您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php pdf文件转图片

2024/2/19 19:36:27发布31次查看
为什么会文件读取不到,路径 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;}
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product