How to do it using PHP exec and Image MagicK to get the first PDF page and convert it to JPG?
There are already many search results on SO .
You have a choice between two duplicates:
ImageMagick / Imagick converts PDF to JPG using its own PHP API using PHP IM bindings.
Imagemagick convert pdf to png using the command line.
Please note that for this you need to install Ghostscript along with ImageMagick. (I think this is usually the case.)
, n- :
convert file.pdf[n] output_file.jpg
, , file.pdf[0].
file.pdf[0]
, :
convert file.pdf output_file.jpg
output_file-0.jpg, output_file-1.jpg, ..., output_file-n.jpg