Using ImageMagick PHP extension to convert PDF image to thumbnails .
*1.Install imagemagick in ubuntu *
sudo apt-get install imagemagick
2.Install imagemagick PECL extension
sudo apt-get install php5-imagick
Restart apache web server
sudo service apache2 restart
PHP script
<?php
$im = new imagick('file.pdf[0]');
$im->setImageFormat('jpg');
header('Content-Type: image/jpeg');
echo $im;
?>
Note that the file name is file.pdf .
You can also resize the image by adding the following line
$im->thumbnail(200,200);
This will resize the image into 200*200.
For more info read this -
Written by Sagar Karira
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#