我试图制作托管在另一台服务器上的 pdf 文件的缩略图。我目前的代码是:
<?php
$im = new imagick("http://www.d3publisher.us/Walkthroughs/Naruto_NC_3_DS.pdf");
$im->setImageFormat('jpg');
header('Content-Type: image/jpeg');
echo $im;
?>
问题是代码只为pdf文件的最后一页生成缩略图。我怎样才能只为第一页制作缩略图?我试图在 imagick 行添加 [0]。
$im = new imagick("http://www.d3publisher.us/Walkthroughs/Naruto_NC_3_DS.pdf[0]");
但它没有用。它仅适用于本地 pdf 文件,即:
$im = new imagick("my-pdf-file.pdf[0]");
请帮我解决这个问题..谢谢..