1
votes

I am looking for a solution to that problem, I am trying to convert pdf to image using php image magic, here is the code, I have tried many solutions but still I am not able to understand why it shows same issue every time

 $FILE = realpath(__DIR__ . '/file.pdf');
        $im = new Imagick();
        $im->pingImage($FILE);
        $pageCount = $im->getNumberImages();
        echo $pageCount;

If I put jpg file in it, works fine, but if I add file.pdf it shows this error

Fatal error: Uncaught ImagickException: PDFDelegateFailed `The system cannot find the file specified. ' @ error/pdf.c/ReadPDFImage/794

Note: I have installed ghost script 9.52 64 bit , Imagick 7. something! , I am looking for the help

1

1 Answers

0
votes

I had the same problem and after a week trying to fix, I discovered that this problem seems to be related to the recents Ghostscript version.

I solved removing it and installing the version 9.26 after trying all of those.