Why the file cannot be read, the path PDF file permissions are set
$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; } }
Error content: Fatal error:uncaught exception ' imagickexception ' with message ' Failed to read the file ' in
Reply content:
Why the file cannot be read, the path PDF file permissions are set
$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; } }
Error content: Fatal error:uncaught exception ' imagickexception ' with message ' Failed to read the file ' in
$PDF Use absolute paths?
try { // read img} catch (ImagickException $e) { echo exception;}