Page 1 of 1

Imagick PHP error: PDF to image converting

Posted: 2010-01-25T02:01:32-07:00
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?

Re: Imagick PHP error: PDF to image converting

Posted: 2010-01-25T09:54:18-07:00
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?

Re: Imagick PHP error: PDF to image converting

Posted: 2010-02-05T04:20:40-07:00
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?