Alfred
Alfred

Reputation: 21396

pdf thumbnail imagemagick php not working

I am using imagemagick and ghostscript in my windows pc running php5 in apache.

I tried

<?php
$im = new imagick('test.pdf[0]');
$im->setImageFormat( "jpg" );
header( "Content-Type: image/jpeg" );
echo $im;
?>

and found its not working.

My php info file shows imagick working...

enter image description here

I am trying to generate a thumbnail without saving it in the server hard drive...

Upvotes: 3

Views: 2046

Answers (1)

Marc B
Marc B

Reputation: 360662

You're outputting the imagick OBJECT, not the image you're dealing with. To output as a .jpg, you'd need to do

echo $im->getImageBlob();

Upvotes: 3

Related Questions