简体   繁体   中英

imagick installation in xampp 1.7.3

I need to PDF file Convert to image using php. so i try to installed imagick and tryed to convert pdf to image but it show in below Error

Code:

$pagenumber=1;
$myurl = $_SERVER['DOCUMENT_ROOT'].'/test/filename.pdf['.$pagenumber.']';
$image = new Imagick($myurl);
$image->setResolution( 300, 300 );
$image->setImageFormat("png");
$image->writeImage('newfilename.png');
echo $image;

Error :

  Fatal error: Uncaught exception 'ImagickException' with message 'Postscript delegate failed `C:/xampp/htdocs/test/filename.pdf': No such file or directory @ pdf.c/ReadPDFImage/611' in C:\\xampp\\htdocs\\test\\image.php:7 Stack trace: #0 C:\\xampp\\htdocs\\test\\image.php(7): Imagick->__construct('C:/xampp/htdocs...') #1 {main} thrown in C:\\xampp\\htdocs\\test\\image.php on line 7 

You can find some useful info on imagick not able to handle pdf here

http://imagemagick.org/discourse-server/viewtopic.php?f=2&t=23879
  1. Can you try and load the same pdf using ghostscript?
  2. What is the version of your pdf file

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM