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.

Resources

Documentation

Requirements
  • Yii 1.0 or above
  • TCPDF 4.2.007 or above
Installation
  • 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
Usage

See the following code example:

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

Downloads

show all