PDF joining limited to 14 files... convert: Postscript delegate failed
Posted: 2017-09-22T18:37:50-07:00
I have a PHP script which uses ImageMagick to join PDF's, this work well up to a point.
However beyond joining 14 PDF files I get errors every time (error is ... convert: Postscript delegate failed), the pdf join is always limited to 14 PDF's, no matter what pdf files selected, the PDF files exist in the correct location and are not corrupted. The outputted joined PDF file only ever has 14 of the joined files. I've tried uninstalling ghostscript and ImageMagick and reinstalling via SSH but the issue persists. I've tried the script on three separate servers and get the same result. Troubleshooting with my hosting provider they said the server resources were not stretched during the operation and they believe the issue lies with ImageMagick.
How do I resolve this? Or are there alternate methods to join pdf's using ImageMagick which don't have issues of limits?
Below is the relevant snippet of conversation I had with the hosting provider...
Code: Select all
function show_Names($e) { return "/home/me/public_html/temp/".$e['pdffilename'].".pdf "; }
$c = array_map("show_Names", $_POST['item']);
exec("convert -density 300 ".implode(' ', $c)."/home/me/public_html/temp/latest.pdf", $array);
How do I resolve this? Or are there alternate methods to join pdf's using ImageMagick which don't have issues of limits?
Below is the relevant snippet of conversation I had with the hosting provider...
Client: how do I uninstall/reinstall 'Ghostscript' via SSH?
Hosting: yum remove ghostscript ... Now did that also remove ImageMagick?
Client: ok removed
Hosting: then ... yum install ghostscript ... once that is finished...yum install ImageMagick
Client: ok done
Hosting: Then restart server. This should handle whatever issue you are encountering...Is there anything else I can do for you today?
Client: I get the following error when I try to join more than 14 pdf's...
[Fri Sep 22 20:30:37.154256 2017] [:error] [pid 24561] [client 49.228.229.55:28442] convert: Postscript delegate failed `/home/me/public_html/temp/59c2a820e96bc.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664., referer: ****
[Fri Sep 22 20:30:37.148379 2017] [:error] [pid 24561] [client 49.228.229.55:28442] convert: Postscript delegate failed `/home/me/public_html/temp/59c584bad4a7f.pdf': No such file or directory @ error/pdf.c/ReadPDFImage/664, referer: *****
So here I tried to join 16 pdfs, but the final 2 pdf's gives the above error on those pdfs. Those files 100% exist and are not corrupted. No matter which PDF's I select to join, any pdf's selected beyond 14 always get the above error on them, every time. Is this a limit of the server resources?
Hosting: Looking over, it looks like this is a problem with the program itself, not really the server. I'm not seeing anything we can do on our end, I would contact the creator of the program and seek support.
Client: Just to confirm, the resources of the server were not stretched during the pdf join operation a few minutes ago ie, memory, hard drive space, cpu limits?
Ryan S: Not that I can see on my end.
Client: Thanks, will go to their support forum with info