Problem to save at PDF format

Topics: Developer Forum
Jan 8, 2013 at 2:23 PM


I am using PHPExcel to export to excel and PDF. The excel format havent problem, but when i try to export to PDF, i get the next error:

PDF Rendering library has not been defined

I am using this code:


$objPHPExcel = new PHPExcel;

$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "PDF");

$objSheet = $objPHPExcel->getActiveSheet();

$objSheet->setTitle('My sales report');





$objSheet->getCell('D1')->setValue('Total Price');



Could i can do?


Jan 9, 2013 at 7:45 AM

You need to tell PHPExcel what PDF rendering library you are using, either tcPDF, mPDF or DomPDF.... and this needs to be installed separately. Look at the examples to see how it should be defined for PHPExcel