FPDF: Dynamic PDF creation with PHP made easy

FPDF is a PHP class which allows to generate PDF files with pure PHP, that is to say without using the PDFlib library. The advantage is that PDFlib requires a fee for a commercial usage. F from FPDF stands for Free: you may use it for any kind of usage and modify it to suit your needs.

I’ve been using this class for PHP PDF creation!!!

This is really easy to use and it gave me better results than any other i’ve tried.

Download FPDF from here

This is just a CODE sample:

< ?php
require('fpdf.php');

class PDF extends FPDF
{
//Page header
function Header()
{
//Logo
$this->Image('scheda.jpg',10,10,190);
//Arial bold 15
$this->SetFont('Arial','B',15);
//Move to the right
$this->Cell(80);
//Line break
$this->Ln(20);
}
}
//Instanciation of inherited class
$pdf=new PDF();
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Helvetica','',12);
$pdf->Image('../Immagini/Foto/'.$line['Codice'].'.jpg',56.8,119.9,103.6,72.5);
$pdf->Image('../Immagini/Disegni/'.$line['Codice'].'.jpg',56.8,197.9,103.6,72.5);
//for($i=1;$i< =40;$i++)
// $pdf->Cell(0,10,'Printing line number '.$i,0,1);
$pdf->Ln(46);
$pdf->Cell(47);
$pdf->Cell(0,10,CODOEM.': '.$line['Descrizione'],0,1);
$pdf->Cell(47);
$pdf->Cell(0,10,CODMA.': '.$line['Codice'],0,1);
$pdf->Cell(47);
$pdf->Cell(0,10,MARCA.': '.$line['categoria'],0,1);
$pdf->Output();
?>

Related Posts with Thumbnails

Popularity: 3%

Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

No Responses to “FPDF: Dynamic PDF creation with PHP made easy”

Leave a Reply:

Name (required):
Mail (will not be published) (required):
Website:
Comment (required):
XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Indirizzo per il Trackback