為什麼會檔案讀取不到,路徑 pdf檔權限都已設定
<code>$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; } } </code>
報錯內容:Fatal error: Uncaught exception 'ImagickException' with message 'Failed to read the file' in
為什麼會檔案讀取不到,路徑 pdf檔權限都已設定
<code>$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; } } </code>
報錯內容:Fatal error: Uncaught exception 'ImagickException' with message 'Failed to read the file' in
$PDF使用絕對路徑呢
<code>try { // read img } catch (ImagickException $e) { echo exception; }</code>