十年網(wǎng)站開發(fā)經(jīng)驗(yàn) + 多家企業(yè)客戶 + 靠譜的建站團(tuán)隊(duì)
量身定制 + 運(yùn)營(yíng)維護(hù)+專業(yè)推廣+無憂售后,網(wǎng)站問題一站解決
這篇文章主要介紹php pdf轉(zhuǎn)jpg的方法,文中介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們一定要看完!
創(chuàng)新互聯(lián)成都網(wǎng)站建設(shè)按需設(shè)計(jì)網(wǎng)站,是成都營(yíng)銷推廣公司,為成都陽光房提供網(wǎng)站建設(shè)服務(wù),有成熟的網(wǎng)站定制合作流程,提供網(wǎng)站定制設(shè)計(jì)服務(wù):原型圖制作、網(wǎng)站創(chuàng)意設(shè)計(jì)、前端HTML5制作、后臺(tái)程序開發(fā)等。成都網(wǎng)站設(shè)計(jì)熱線:13518219792
php pdf轉(zhuǎn)jpg的方法:首先安裝Image Magick擴(kuò)展;然后通過“exec('convert "'.$pdf_file.'" -colorspace RGB -resize 800 "'...)”方式進(jìn)行轉(zhuǎn)換即可。
這是一個(gè)非常簡(jiǎn)單的格式轉(zhuǎn)換代碼,可以把.PDF文件轉(zhuǎn)換為.JPG文件,代碼要起作用,服務(wù)器必須要安裝Image Magick 擴(kuò)展。
$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.".$output;
以上是php pdf轉(zhuǎn)jpg的方法的所有內(nèi)容,感謝各位的閱讀!希望分享的內(nèi)容對(duì)大家有幫助,更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道!