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.
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();
?>
Popularity: 3%
