imageMagick
Ghostscript
I've figured how to write php to convert a pdf to a jpg thumbnail. But I'm having trouble understanding the commands a little bit.
I'm successful in creating a thumbnail from pdf like so...
Code: Select all
/***
*
* Create Thumbnail
*
*/
flush();
ob_flush();
$targetThumb = "$dir_targetDir/" . basename($fileName, '.pdf') . "_thumb.jpg";
$pdf = $filePath;
$command = "e:\\php\convert $pdf -colorspace RGB -geometry 200 $targetThumb ";
exec("$command");
test.pdf_thumb-0.jpg
test.pdf_thumb-1.jpg
test.pdf_thumb-2.jpg
I have tried:
Code: Select all
$command = "e:\\php\convert $pdf[0] -colorspace RGB -geometry 200 $targetThumb ";
How do I get the page information to tell IM I only want the first one?