duan3601 2019-05-02 21:01
浏览 2401

致命错误:Uncaught ImagickException:PDFDelegateFailed

I want to display PDF files like image files on my WebPage on Apache2.4 on PHP7 in Windows 2008 Server, but I'm having the next error:

Fatal error: Uncaught ImagickException: PDFDelegateFailed

I already have installet ImageMagick-7.0.8-Q16 and Ghostscript 9.27 (32 bits) I replace Ghostcript 9.27 - 64 bits because the Apache Server shutdown inmediatly and restart. Here I found this note here: PHP: Uncaught ImagickException: PDFDelegateFailed .

On Command Line window:

If I run magick file.pdf file.jpg it's work.

If I run magick -verbose file.pdf file.jpg it's work and i see that it's using gswin32c.exe.

I have the same WebPage on my computer with Win10 Pro, same Imagick version, same ghostscript version, same Apache version, same PHP version and it's working fine.

$pdfInfo = new Spatie\PdfToImage\Pdf($file);
while ($page < $pdfInfo->getNumberOfPages()) {
  $imagick = new Imagick();
  $imagick->setResolution(100, 100);
  $imagick->readImage(sprintf('%s[%s]', $file, $page));
  echo sprintf('<img src="data:image/%s;base64,%s" ><br>', $type, base64_encode($imagick));
  $page++;
  • 写回答

1条回答 默认 最新

  • douqiang1910 2019-06-06 14:20
    关注

    The problem was the Ghostscript version. I had to replace the gs executable file from the Ghostscript page for the last version and it works fine.

    评论

报告相同问题?

悬赏问题

  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿
  • ¥15 回答4f系统的像差计算
  • ¥15 java如何提取出pdf里的文字?