I'm trying to convert a pdf on my local computer to a jpg file and then using Tesseract to read the image text. Simply testing code like this:
$pdf = new Pdf('C:\testing\test.pdf');
$pdf->saveImage('C:\testing\test.jpg');
$tess = new TesseractOCR('C:\testing\test.jpg');
$myresults = $tess->run();
$this->vars['result'] = $myresults;
Produces the following error: PDFDelegateFailed `The system cannot find the file specified. ' @ error/pdf.c/ReadPDFImage/794
I am using the following for my scenario:
OctoberCMS/Laravel
PHP 7.2.34 64 bit
Ghostscript 9.53.3 64 bit (32 bit didn't work either)
ImageMagick 7.0.7-11 Q16 x64
Xampp
Windows 10 64 bit
When I try converting a jpg to a png, ImageMagick works fine, but as soon as I try a PDF, I get the error. I have looked and tried solutions with little luck. I know the issue is most likely Ghostscript, as many have reported that it's the one that gives the most headaches on Windows 10, but I have no idea where to even begin trying to connect it to ImageMagick.
Any help, please?