<?php
$dir_pdf = "http://example.com/test/uploads/test_file.pdf";
$dir_thumbnail = "http://example.com/test/uploads/test_file.jpg"
$im = new Imagick();
$im->readImage($dir_pdf);
header("Content-Type: image/" . $im->getImageFormat());
echo $im;
?>
In folder "uploads" i have a pdf file
My server installed Imagick & Ghostscript
Why this code can't run :) Thank you .
<?php
$im = new Imagick("uploads/test_file.pdf[0]");
$im->setImageFormat("jpg");
$type=$im->getFormat();
header("Content-type: $type");
echo $im->getimageblob();
?>
this is my code :)
I put test_file.pdf in folder uploads
it work ^^!