Generate PDF’s in CodeIgniter using this easy to use library based on domPDF.
- Drop the pdf.php library into your libraries directory.
- Download domPDF from http://code.google.com/p/dompdf/downloads/list
- Drop the dompdf directory into your libraries directory alongside the pdf.php file.
You can convert a view into a PDF by using the following code.
$this->load->library('pdf'); $this->pdf->load_view('welcome'); $this->pdf->render(); $this->pdf->stream("welcome.pdf");
You can also pass in data to the function just as you would using
$this->load->view('welcome', $data); by using
For more information on how to use domPDF then please visit: http://code.google.com/p/dompdf/wiki/Usage
- CodeIgniter PDF Library – MIT License
- domPDF – GNU Lesser GPL
download from here