开发者

pdf thumbnail imagemagick php not working

开发者 https://www.devze.com 2023-03-04 22:57 出处:网络
I am using imagemagick and ghostscript in my windows pc running php5 in apache. I tried <?php $im = new imagick(\'test.pdf[0]\');

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" );开发者_C百科
echo $im;
?>

and found its not working.

My php info file shows imagick working...

pdf thumbnail imagemagick php not working

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


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();
0

精彩评论

暂无评论...
验证码 换一张
取 消