From kodeboard, 4 Years ago, written in PHP.
Embed
  1. $pdf_file   = 'file.pdf';
  2. $png_file   = 'file.png';    
  3.  
  4. //execute ImageMagick command 'convert' and convert PDF to PNG with applied settings
  5. exec('convert "'.$pdf_file.'" -colorspace RGB -resize 800 "'.$png_file.'"', $output, $return_var);
  6.  
  7.  
  8. if($return_var != 0) {  
  9.     print "Uh oh..." . $output;
  10. }
  11.  

You must login to reply or comment on this code.