Imagick PHP error: PDF to image converting

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
timkant

Imagick PHP error: PDF to image converting

Post by timkant »

Hi,

I'm trying to create jpg thumbnails from PDF file. For this, I use native Imagick with PHP on a Linux server. 50% of the time it works just fine, however the other 50% of PDF files give me this error:

Code: Select all

Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `uploaded_files/documents/9a6237a473.pdf': pSJV.cache @ pdf.c/ReadPDFImage/635' in /home/sopw/domains/sopw.nl/public_html/udoc/modules/_frontend/upload/controllers/test_thumb.ctr.php:48 Stack trace: #0 /home/sopw/domains/sopw.nl/public_html/udoc/modules/_frontend/upload/controllers/test_thumb.ctr.php(48): Imagick->__construct('uploaded_files/...') #1 /home/sopw/domains/sopw.nl/public_html/udoc/includes/frontend/frontend.component_init.inc.php(12): require('/home/sopw/doma...') #2 /home/sopw/domains/sopw.nl/public_html/udoc/includes/main/main.sitebuilder.inc.php(13): require('/home/sopw/doma...') #3 /home/sopw/domains/sopw.nl/public_html/udoc/index.php(3): require('/home/sopw/doma...') #4 {main} thrown in /home/sopw/domains/sopw.nl/public_html/udoc/modules/_frontend/upload/controllers/test_thumb.ctr.php on line 48
I can't figure out what's going wrong. Does it have something to do with the security settings in the PDF files?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: Imagick PHP error: PDF to image converting

Post by magick »

Do you have Ghostscript installed and at the latest version available?

Perhaps the problem is specific to certain PDF's. Convert them from the command line:
  • convert 9a6237a473.pdf null:
Does it report any problems interpretting the file?
timkant

Re: Imagick PHP error: PDF to image converting

Post by timkant »

Yeah, GhostScript is installed, and most of the PDF file are converted. Only some PDF's give this problem.

I can't convert a file with a command line, i don't have command line acces to the server...

Could it have something to do with the MIME type?
Post Reply