Page 1 of 1

Postscript Delegate Failed, many fixes tried

Posted: 2012-10-07T18:04:31-07:00
by mcescalante
I am looking to get ImageMagick working with gs and imagick. I am trying to execute the line of code:

Code: Select all

$img = new Imagick($pdf_file."[0]");
When I do, I get this error:

Code: Select all

exception 'ImagickException' with message 'Postscript delegate failed...
I have done quite a bit of Googling / attempts to fix this. I have (in no order)
- Reinstalled gs and ImageMagick (currently imagick is giving me a bizarre make error due to the fact that I am using the RC rather than the stable)
- Added the extension to php.ini (imagick.so)
- Re-configured the ImageMagick installation to include --with-gslib (gs is added to the list)
- Dynamically linked /usr/bin's
- A few other things (yes, they are all available and installed).

The convert command DOES work, I have tested and confirmed it's usage with the following line which runs fine with no errors. The resulting PDF displays perfectly.

Code: Select all

convert test.pdf test2.pdf
I've exhausted nearly everything I can think of, and most of what Google and other sites have to offer. Does anyone have any advice on the best way to approach this? I'm glad to produce logs and such, just not sure exactly what would help with this error.

Re: Postscript Delegate Failed, many fixes tried

Posted: 2012-10-07T19:01:57-07:00
by fmw42
Below is the correct syntax to get the first page, not what you had at first. There should be no . between $pdf_file and [0] as the $pdf_file should be including the period with suffix, i.e., .pdf

$img = new Imagick("$pdf_file[0]");

Re: Postscript Delegate Failed, many fixes tried

Posted: 2012-10-08T08:58:44-07:00
by mcescalante
fmw42 wrote:I am not an expert on Imagick, but try

$img = new Imagick("$pdf_file[0]");
Thanks for the advice, but the code isn't the issue. pdf_file is not an array, so your edit won't change anything.

Any other thoughts? Would love to get this resolved :(

Re: Postscript Delegate Failed, many fixes tried

Posted: 2012-10-08T09:31:05-07:00
by fmw42
mcescalante wrote:
fmw42 wrote:I am not an expert on Imagick, but try

$img = new Imagick("$pdf_file[0]");
Thanks for the advice, but the code isn't the issue. pdf_file is not an array, so your edit won't change anything.

Any other thoughts? Would love to get this resolved :(
If your pdf file is not a multilayer, multipage file and you are not trying to extract the first [0] layer/page, then what is [0] doing following a period in your command.

Re: Postscript Delegate Failed, many fixes tried

Posted: 2012-10-08T14:59:32-07:00
by mcescalante
fmw42 wrote:If your pdf file is not a multilayer, multipage file and you are not trying to extract the first [0] layer/page, then what is [0] doing following a period in your command.
The pdf is a multilayer multipage pdf that we are extracting the first page of. It displays the first page of the pdf on the webpage. When the code is changed, it throws exactly the same.

This is likely not a code issue, this is almost positively an issue stemming from the fact that imagick is compiled & installed from sources rather than from a package updater. The server config we're using does not allow imagick to be installed correctly with a package updater.

Re: Postscript Delegate Failed, many fixes tried

Posted: 2012-10-08T17:32:09-07:00
by fmw42
Below is the correct syntax to get the first page, not what you had at first. There should be no . between $pdf_file and [0] as the $pdf_file should be including the period with suffix, i.e., .pdf

$img = new Imagick("$pdf_file[0]");