'Fatal error: Uncaught ImagickException: FailedToExecuteCommand `"gs"
I'm trying to convert a pdf file to image using Imagick. I got this error mesage
Fatal error: Uncaught ImagickException: FailedToExecuteCommand `"gs" -sstdout=%stderr -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dPrinted=false -dFirstPage=1 -dLastPage=1 "-sOutputFile=C:/Users/hp/AppData/Local/Temp/magick-a_S3iN3QlF_AJpu__QSB2IRn91LwCaFO%d" "-fC:/Users/hp/AppData/Local/Temp/magick-oL7dQzHWcGhyd11TWDCo8y1-QhlmOiWt" "-fC:/Users/hp/AppData/Local/Temp/magick-w3UGDDgD9de6Pu4NP3TlLvUHNVbYNMHw"' (Le fichier sp�cifi� est introuvable. ) @ error/delegate.c/ExternalDelegateCommand/516 in C:\xampp\htdocs\mydomain\test_imagik.php:2 Stack trace: #0 C:\xampp\htdocs\mydomain\test_imagik.php(2): Imagick->__construct('C:/xampp/htdocs...') #1 {main} thrown in C:\xampp\htdocs\mydomain\test_imagik.php on line 2
my code
<?php
$im = new Imagick($_SERVER['DOCUMENT_ROOT'] . '/mydomain/files/pdf_canevas/doc_1025.pdf[0]');
$im->setImageFormat('jpg');
header('Content-Type: image/jpeg');
echo $im;
?>
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|