M
M
maks789452022-01-24 18:10:39
Laravel
maks78945, 2022-01-24 18:10:39

Why can't Spatie PdfToImage see the pdf file?

I use this package https://github.com/spatie/pdf-to-image
I transfer pdf:

$pathToPdf = "C:/OpenServer/domains/loc.domain.com.ua/public/storage/pdf/3/111.pdf"
$pdf = new Spatie\PdfToImage\Pdf($pathToPdf);


but getting ImagickException on $this->imagick->pingImage($pdfFile) in file
C:\OpenServer\domains\loc.domain.com.ua\vendor\spatie\pdf-to-image\src\Pdf.php:40


public function __construct(string $pdfFile)
    {
        if (! file_exists($pdfFile)) {
            throw new PdfDoesNotExist("File `{$pdfFile}` does not exist");
        }
        $this->imagick = new Imagick();
        $this->imagick->pingImage($pdfFile); //вот в этом месте
        $this->numberOfPages = $this->imagick->getNumberImages();
        $this->pdfFile = $pdfFile;
    }


I would be very grateful for help in solving

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question