如何将PDF文件利用imagebrick高效转换成图片格式?
- 内容介绍
- 文章标签
- 相关推荐
本文共计72个文字,预计阅读时间需要1分钟。
php
<?php $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 exec('convert "'.$pdf_file.'" -colorspace RGB -resize 800 "'.$save_to.'"', $output, $return_var); if($return_var == 0) { //if exec successfuly converted pdf to jpg print "Conversion OK"; } else print "Conversion failed.<br />".$output; ?>
本文共计72个文字,预计阅读时间需要1分钟。
php
<?php $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 exec('convert "'.$pdf_file.'" -colorspace RGB -resize 800 "'.$save_to.'"', $output, $return_var); if($return_var == 0) { //if exec successfuly converted pdf to jpg print "Conversion OK"; } else print "Conversion failed.<br />".$output; ?>

