Pdf Output


Table of Contents

How to use the sfFPDF plugin 
FPDF Tutorials 
sfOpenOfficePlugin 

How to use the sfFPDF plugin 

I have a hard time to understand how to extend and use sfFPDF. Let say I want to extend the class and add some of the code that can be found here : http://www.fpdf.org/ in the scrips page.

You can now extend sfFPDF easily. To use sfFPDF in your action:

$fpdf = new sfFPDF();
$pdf = $fpdf->getFPDF();
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf->Cell(40,10,'Hello World!');
$pdf->Output();

then only return the headers in your action:

return sfView::HEADER_ONLY;

You will need to set the content-type to be pdf too.

FPDF Tutorials 

http://www.fpdf.org/en/tutorial/index.php

The different examples rapidly show how to use FPDF. You will find all main features explained.

documented on: 2007.03.16