简体   繁体   English

对于特定的 pdf,php 中的想象异常?

[英]imagick exception in php for a particular pdf?

i am using imagick library to convert pdf to jpeg images but imagick gives exception for a particular pdf file.我正在使用 imagick 库将 pdf 转换为 jpeg 图像,但 imagick 对特定的 pdf 文件给出了例外。

An uncaught Exception was encountered Type: ImagickException遇到未捕获的异常类型:ImagickException

Message: Failed to read the file.消息:读取文件失败。

link to my pdf file is: http://3.16.128.27/wesign/files/33e75ff09dd601bbe69f351039152189/group-1572499418b6192849b6ed8bcc333842d4faba342b.pdf link to my pdf file is: http://3.16.128.27/wesign/files/33e75ff09dd601bbe69f351039152189/group-1572499418b6192849b6ed8bcc333842d4faba342b.pdf

Your PDF file uses a deprecated method for defining resources;您的 PDF 文件使用不推荐使用的方法来定义资源; it relies on inheritance from a parent object.它依赖于父 object 的 inheritance。

Each page in your file does more or less nothing except execute a Form XObject.文件中的每个页面都或多或少地除了执行 Form XObject 之外什么都不做。 In many cases these XObjects do nothing but execute yet more XObjects.在许多情况下,这些 XObject 只会执行更多的 XObject。 In any event eventually we reach an XObject which does some drawing.无论如何,最终我们会得到一个 XObject,它会做一些绘图。 Some of thohse XObjects use resources, such as fonts, but do not declare a Resources dictionary to tell the PDF consumer how to locate the named resource.一些 XObjects 使用资源,例如 fonts,但没有声明资源字典来告诉 PDF 使用者如何定位命名资源。 Instead they rely on inheriting the Resources dictionary from the parent.相反,它们依赖于从父级继承 Resources 字典。

This is legal, though deprecated.这是合法的,但已被弃用。

Its possible that you are simply using an old version of Ghostscript which doesn't like this construction.您可能只是使用不喜欢这种结构的旧版本的 Ghostscript。 The current version is 9.50 and you could try simply upgrading.当前版本是 9.50,您可以尝试简单地升级。

Other than that you'll need to debug the delegate call, I think -debug all will provide at least some information but I'm not an expert on imagemagick除此之外,您需要调试委托调用,我认为-debug all至少会提供一些信息,但我不是 imagemagick 的专家

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM