简体   繁体   English

pdf thumbnail imagemagick php无法正常工作

[英]pdf thumbnail imagemagick php not working

I am using imagemagick and ghostscript in my windows pc running php5 in apache. 我在我的windows pc中使用imagemagick和ghostscript在apache中运行php5。

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... 我的php信息文件显示了imagick work ...

在此输入图像描述

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. 你正在输出想象的OBJECT,而不是你正在处理的图像。 To output as a .jpg, you'd need to do 要输出为.jpg,您需要这样做

echo $im->getImageBlob();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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