sfTCPDFPlugin - 1.5.3

sfTCPDFPlugin class provides abstraction for the TCPDF library.

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source | Show as Markdown


sfTCPDFPlugin class provides abstraction for the TCPDF library. The main interest of this FPDF extension resides in the fact that it handles any UTF8 strings.


  • Install the plugin

    symfony plugin-install http://plugins.symfony-project.com/sfTCPDFPlugin

    or download it and unzip in your /plugins directory

  • Download the TCPDF library

  • Unzip it inside the /plugins/sfTCPDFplugin/lib folder

At this point, you should have a tcpdf folder in /plugins/sfTCPDFPlugin/lib

  • Copy the files in /web/sfTCPDFPlugin directly to your application /web directory

  • Clear you cache

    symfony cc


  • Modify /web/sfTCPDFPlugin/config/config.php with your own settings, path and url are automatically set

  • You can modify this file or create a module called sfTCPDFP in your application

  • If you want to have custom settings for each generated PDF, delete the constant section and copy/paste in your application.

  • If you want to run the tests, enable the sfTCPDF module in your setings.yml file, then call sfTCPDF/test or sfTCPDF/test2


  • 1 - Hello World test (sfTCPDF/test)


    • Hello world test */ public function executeTest() { // pdf object $pdf = new sfTCPDF();

      // settings $pdf->SetFont("FreeSerif", "", 12); $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT); $pdf->setHeaderFont(array(PDF_FONT_NAME_MAIN, *, PDF_FONT_SIZE_MAIN)); $pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING); $pdf->setFooterFont(array(PDF_FONT_NAME_DATA, *, PDF_FONT_SIZE_DATA)); $pdf->SetHeaderMargin(PDF_MARGIN_HEADER); $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

      // init pdf doc $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->Cell(80, 10, "Hello World !!! & é € U û いろは");

      // output
      $pdf->Output(); return sfView::NONE; }

  • 2 - Full test (sfTCPDF/test2, check /plugins/sfTCPDFPlugin/actions/actions.php)



  • Initial version for TCPDF 1.53 TC030



  • I seems there are problems with the TCPDF class when using PHP 5.1.x
  • I am searching beta testers to get some feeback. (C0il on IRC on, comment on my blog or whatever you want !)


Plugin support

  • Please report bugs/feeback in the plugin section of the forum
  • You can find also contact me on IRC or by email (check README file)

COil :)