/ Published in: PHP
#ImageMagick must be installed on server for this operation
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * PDF2JPG script * with ImageMagick */ $pdf_file = './pdf/demo.pdf'; $save_to = './jpg/demo.jpg'; //make sure that apache has permissions to write in this folder! (common problem) //execute ImageMagick command 'convert' and convert PDF to JPG with applied settings if($return_var == 0) { //if exec successfuly converted pdf to jpg print "Conversion OK"; } else print "Conversion failed.<br />".$output;