I have a script which opens a pdf document to check how many pages there are in the document and converts each page to jpg. Now the error does not always come up. Only with some. But I have not figured out why or why not it happens. this is the error log line 1150 code is $im = new imagick($target_path); PHP: the code is executed immediately after the pdf file has been uploaded and moved to a folder. The file does exists when it gets to that point and like I said sometimes it works, sometimes it doesn't. Size does not matter as I have a pdf file with 20 pages which works and file with 1 page which doesn't work. any help or direction would really be appreciated. Thanks.
if it sometimes works and sometimes doesnt you may want to check your php configuration settings and make sure you are allowing enough resources.
I tried something out. I simply used an online pdf joiner and joined a 1 page document that didn't work together (new document has 2 pages that are identical) and it worked. So what I am trying to figure out now is how I can open an existing pdf and create a new pdf from it. Any Idea???
I don't know whether it helps, but recently I tried to convert pdf to jpg and the problem was with old ghostrscript version. Though I used imagemagick convert utility I guess it uses ghostscript internally and I couldn't convert some pdf files. When ghostscript was updated to version 9 convert worked fine. P.S. Actually I used ghostscript without imagemagick, cause it provided better quality (I could not change dpi with imagemagick). You can google smething like "ghostscript pdf to png" for details, maybe you can even join two pdfs to one.