I'm trying to convert a pdf into image using the Imagick library as follows:
<?
header('Content-type: image/jpeg');
$imagick = new Imagick();
// O myfile se encontra na mesma pasta do arquivo que estou executando
$imagick->readImage('myfile.pdf');
$imagick->writeImages('myfile.jpg', false);
I'm having the following error:
Fatal error: Uncaught exception 'ImagickException' with message 'Unable to read the file: myfile.pdf' in /Users/myuser/teste.php:11 Stack trace: 0 /Users/myuser/teste.php(11): Imagick-> readimage ('myfile.pdf') 1 {main} thrown in /Users/myuser/teste.php on line 11
What could it be?