TCPDF CodeIgniter Integration

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

Category:Contributions::Applications::TCPDF Category:Contributions::Libraries::Files Category:Contributions::Libraries::PDF Category:Libraries::Community

Making TCPDF work with CodeIgniter

  1. Create a 3rdparty folder inside your application folder:
  1. Download TCPDF and extract it into the 3rdparty folder you just created. You should now have:
  1. Download the TCPDF integration library and install it in your application folder:
  1. Configure the tcpdf.php config file as needed

  2. Test controller:

class pdf_test extends Controller {

    function pdf_test()

    function tcpdf()

        // set document information
        $this->pdf->SetSubject('TCPDF Tutorial');
        $this->pdf->SetKeywords('TCPDF, PDF, example, test, guide');
        // set font
        $this->pdf->SetFont('times', 'BI', 16);
        // add a page
        // print a line using Cell()
        $this->pdf->Cell(0, 12, 'Example 001 - €àèéìòù', 1, 1, 'C');
        //Close and output PDF document
        $this->pdf->Output('example_001.pdf', 'I');