I'm using Imagick to convert a PDF to JPG, but when I'm trying to use the class, it throws me a fatal error and a ImagickException without any explaination.
Fatal error: in C:\wamp64\www\wordpress\wp-content\plugins\formprocess-plugin\back-end\devis_validation.php on line 83
ImagickException: in C:\wamp64\www\wordpress\wp-content\plugins\formprocess-plugin\back-end\devis_validation.php on line 83
Here is the code I'm using :
$devis_path = $_SERVER['DOCUMENT_ROOT'].'/wordpress/devis_pdf/'.$_SESSION['email'].'/DEVIS_'.$_POST['id_devis'].'.pdf';
$devis_img = $_SERVER['DOCUMENT_ROOT'].'/wordpress/devis_pdf/'.$_SESSION['email'].'/';
$im = new Imagick($devis_path);
$im->setImageFormat('jpg');
file_put_contents($devis_img, $im);
$devis_path and $devis_img are set, so I really don't know where's the problem.