You can't. Well I guess anything is possible but you'd need to render the PDF which is no small task.
i can with imagick (php_imagick.dll) can convert pdf to jpeg but i use xampp it make error <?php $im = new imagick('database.pdf[0]'); $im->setImageFormat( "jpg" ); header( "Content-Type: image/jpeg" ); echo $im; ?> PHP: error: Fatal error: Uncaught exception 'ImagickException' with message 'Unable to read image' in D:\xamp\xampp\htdocs\thmubnail\pdf.php:3 Stack trace: #0 D:\xamp\xampp\htdocs\thmubnail\pdf.php(3): Imagick->__construct('database.pdf[0]') #1 {main} thrown in D:\xamp\xampp\htdocs\thmubnail\pdf.php on line 3 how can fix it ??
Dear, I put you code in test.php file and put database.pdf u that folder. I also uncomment php_imagic.dll in php.ini and restart the server. Also GD2 in uncommented. [php.ini] --- ;extension=php_fribidi.dll extension=php_gd2.dll extension=php_gettext.dll --- ;extension=php_iisfunc.dll extension=php_imagick.dll extension=php_imap.dll --- when I egzecute you code I get message : Fatal error: Class 'imagick' not found in C:\xampp\htdocs\test\test.php on line 2 What is wrong? what can I check??