幫助我,我要保存爲PDF格式 代碼擅長:PHPExcel保存PDF
include_once 'Classes/PHPExcel.php';
/** PHPExcel_IOFactory */
require_once ('Classes/PHPExcel/IOFactory.php');
include_once ('Classes/PHPExcel/Writer/Excel2007.php');
include_once ('Classes/PHPExcel/Writer/PDF.php');
include_once ('Classes/PHPExcel/Writer/PDF/DomPDF.php');
$rendererName = PHPExcel_Settings::PDF_RENDERER_DOMPDF;
//$rendererLibrary = 'tcPDF5.9';
//$rendererLibrary = 'mPDF5.4';
$rendererLibrary = 'domPDF0.6.0beta3';
$rendererLibraryPath = '/' . $rendererLibrary;
$objPHPExcel->getActiveSheet()->setTitle('Orari');
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF');
$objWriter->setSheetIndex(0);
$objWriter->save('esp.pdf');
我想在PDF格式保存,但是當我嘗試保存我從phpexcel錯誤響應: 致命錯誤:在C:\ xampp \ htdocs \ fserv \ Classes \ PHPExcel \ Writer \ PDF \ DomPDF.php中:34無法加載PDF渲染庫的未捕獲異常'PHPExcel_Writer_Exception':34堆棧跟蹤:#0 C: \ xampp \ htdocs \ fserv \ esportatore.php(190):include_once()#1 C:\ xampp \ htdocs \ fserv \ index.php(44):include('C:\ xampp \ htdocs ...')# 2 {main}拋出C:\ xampp \ htdocs \ fserv \ Classes \ PHPExcel \ Writer \ PDF \ DomPDF.php on line
http://stackoverflow.com/questions/20409494/how-to-configure-phpexcel-for-pdf –