mPDF with Codeigniter

Derek Jones edited this page Jul 5, 2012 · 6 revisions
Clone this wiki locally

i have try to find how to make PDF with Codeigniter... but i just find fPDF but that is so Hard... and other way...

now i can add mPDF to Codeigniter 1.7..

Step 1 download mPDF first.. Step 2 extract that file.. i rename it to mpdf.. and place outside or inside of your CI application Step 3 copy mpdf/mpdf.php to CI library.. and Open mpdf.php to change some row...

Original:

if (!defined('_MPDF_PATH')) define('_MPDF_PATH','');

Change:

if (!defined('_MPDF_PATH')) define('_MPDF_PATH','mpdf/');

i place mpdf outside of my CI application Step 4 that is ready to use.. in Controller


$this->load->library('mpdf');
$this->mpdf->WriteHTML('<p>Hello There</p>');
$this->mpdf->Output();

Step 5 Enjoy ^_^

Thanks...

dezafu.redline