11
08月
2015
43. 使用 imagebrick 进行 pdf 到图像的转换
1
2
3
4
5
6
7
8
9
10
|
<?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 ;
?>
|
特殊说明,本文版权归 ning个人博客 所有带原创标签请勿转载,转载请注明出处.