tcpdf PDF generation with TCPDF

ETcPdf is a wrapper for the TCPDF class, which is not bundled, since it's huge (not so much the class itself, but the associated files, making a 9 Mb tarball or 13 Mb unpacked). You can download the class here. Notice that TCPDF is updated almost daily, so I recommend you to update the class file frequently, since new cool features are added on every release. I used TCPDF 4.2.007 while developing this wrapper.



  • Yii 1.0 or above
  • TCPDF 4.2.007 or above
  • Extract the release file under protected/extensions
TCPDF installation:
  • Download the tarball.
  • Unpack it on the extension directory.
  • If necessary, rename the resulting subdirectory to tcpdf
  • You just need to keep these subdirectories inside tcpdf: config, fonts and images, since the cache is stored on the runtime directory, and no docs are needed

See the following code example:

$pdf = Yii::createComponent('application.extensions.tcpdf.ETcPdf', 
                            'P', 'cm', 'A4', true, 'UTF-8');
$pdf->SetAuthor("Nicola Asuni");
$pdf->SetTitle("TCPDF Example 002");
$pdf->SetSubject("TCPDF Tutorial");
$pdf->SetKeywords("TCPDF, PDF, example, test, guide");
$pdf->SetFont("times", "BI", 20);
$pdf->Cell(0,10,"Example 002",1,1,'C');
$pdf->Output("example_002.pdf", "I");
12 9
11 096 downloads
Yii Version: 1.1
License: LGPL-3.0
Category: Others
Developed by: MetaYii
Created on: Nov 19, 2008
Last updated: 15 years ago


show all