什么行不通:
致命错误:未捕获的异常' ImagickException'与消息 ' Postscript委托失败了`/path/to/filename-multiple-pages.pdf':否 这样的文件或目录@ error / pdf.c / ReadPDFImage / 664'在......
当我尝试使用fopen在网上找到的溶剂,然后使用fopen句柄的readImageFile时:
致命错误:未捕获的异常' ImagickException'与消息 '后记代表失败了`/ tmp / magick-rGGsdy9f':没有这样的文件或 目录@ error / pdf.c / ReadPDFImage / 664'
有什么作用:
使用过的PHP代码:
<?php
// this does work for a single page file
// it does NOT work for multiple page file
// it does NOT work when using pdffile.pdf[0]
// it DOES work when using pdffile.pdf[1]
$filename = '/path/to/pdffile.pdf';
$im = new Imagick();
$im->readImage($filename);
$im = $im->mergeImageLayers(Imagick::LAYERMETHOD_FLATTEN);
$im->scaleImage(150, 150, true);
$im->writeImage('/path/to/image/pdffile.jpg');
?>
<?php
// i used alternative code which gave me the second /tmp/ dir error (see above)
$filename = '/path/to/pdffile.pdf';
$pdf_handle = fopen($filename, 'rb');
$doc_preview = new Imagick();
$doc_preview->setResolution(150,150);
$doc_preview->readImageFile($pdf_handle);
$doc_preview->setIteratorIndex(0);
$doc_preview->setImageFormat('jpeg');
$doc_preview->writeImage('/path/to/image/pdffile.jpg');
$doc_preview->clear();
$doc_preview->destroy();
?>
托管服务提供商安装的模块
有谁知道该怎么做?