Imagick功能读取PDF文件


imagick function to read pdf files

$file_path = $this->filePath.'d/'.$this->compId.'/'.$data->project_id.'/'.$result[0]->file_name;
$im = new Imagick();    
$im->pingImage($file_path);

我无法使用上面的代码获得pdf文件响应。

错误:-致命错误:未捕获的异常'ImagickException' with消息"读取文件失败"/电脑/www/api.proofhub.com/public_html/application/core/v2/proof.php: 114

堆栈跟踪:# 0/电脑/www/api.proofhub.com/public_html/application/core/v2/proof.php (114):Imagick→pingimage('/电脑/www/api.pr…')

在继续之前尝试检查文件路径:

$file_path = $this->filePath.'d/'.$this->compId.'/'.$data->project_id.'/'.$result[0]->file_name;
if (! file_exists($file_path)) {
  die('the file path '.$file_path.' does not appear to exist');
}