-
Notifications
You must be signed in to change notification settings - Fork 7.6k
TCPDF Integration
Murad Faridi edited this page Feb 1, 2018
·
12 revisions
Category:Contributions::Applications::TCPDF Category:Contributions::Libraries::PDF
I struggled some some strange nuances on the other TCPDF-CI integration, so I thought that I would just post some notes on how I got it working in a very simple and easy manner.
-
Download TCPDF - http://sourceforge.net/projects/tcpdf/files/
-
Unzip the above download into /application/libraries/tcpdf. Make sure that the main tcpdf.php file is in this directory
-
Create a new file: /application/libraries/Pdf.php:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once dirname(__FILE__) . '/tcpdf/tcpdf.php';
class Pdf extends TCPDF
{
function __construct()
{
parent::__construct();
}
}
/* End of file Pdf.php */
/* Location: ./application/libraries/Pdf.php */
- To create a new PDF you would do something like this in your controller:
$this->load->library('Pdf');
$this->load->view('view_file');