当前位置:Gxlcms > PHP教程 > 使用使用imagebrick将pdf转成图片

使用使用imagebrick将pdf转成图片

时间:2021-07-01 10:21:17 帮助过:26人阅读

  1. $pdf_file = './pdf/demo.pdf';
  2. $save_to = './jpg/demo.jpg'; //make sure that apache has permissions to write in this folder! (common problem)
  3. //execute ImageMagick command 'convert' and convert PDF to JPG with applied settings
  4. exec('convert "'.$pdf_file.'" -colorspace RGB -resize 800 "'.$save_to.'"', $output, $return_var);
  5. if($return_var == 0) { //if exec successfuly converted pdf to jpg
  6. print "Conversion OK";
  7. }
  8. else print "Conversion failed.
    ".$output;
  9. ?>

转成, imagebrick, pdf

人气教程排行