Answer the question
In order to leave comments, you need to log in
How to display a thumbnail of a pdf file on a website?
There are 10 pdf files. Each contains several pages.
The site has a page with links to download and view these pdf files.
I want to display thumbnails of the first pages of PDF files next to it.
Tried Imagick, but something is still wrong.
$myurl = realpath('file.pdf[0]');
$image = new Imagick($myurl);
$image->setResolution( 300, 300 );
$image->setImageFormat( "png" );
$image->writeImage('newfilename.png');
Answer the question
In order to leave comments, you need to log in
In general, it would be better for you to walk along the crown to do a preview in advance
. And in your realpath - is the path recognized correctly?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question