Click to See Complete Forum and Search --> : FPDF help


clonmelog
02-16-2005, 07:50 AM
Hi,

Im using the pdf class to create pdf's on the fly and its workin find so far but i cant find how i would actually insert an image into the pdf in the top left corner.

this is what im workin with:



<?php

include ('db.php');
require('fpdf.php');
$cxn = @ConnectToDb($dbServer, $dbUser, $dbPass, $dbName);
$sql = mysql_query("Select * From tracking Where C_Pass = '19y7tjxh'") or die ("Sql error : " . mysql_error());

if( mysql_num_rows($sql) > 0 ) {

$row = mysql_fetch_array($sql);
$C_Pass = $row["C_Pass"];
$C_Fname = $row["C_Fname"];
$C_Surname = $row["C_Surname"];
$C_Street1 = $row["C_Street1"];
$C_Street2 = $row["C_Street2"];
$C_Town = $row["C_Town"];
$C_City = $row["C_City"];
$C_Country = $row["C_Country"];
$p_id = $row["p_id"];



$pdf=new FPDF();
$pdf->AddPage();

$pdf->SetFont('Helvetica','U',16);
$pdf->Cell(70,10,'logo here');
$pdf->Cell(80,10,'SAA Online shopping Invoice');
$pdf->Ln(40);

$pdf->SetFont('Helvetica','',12);
$pdf->Cell(70,10,'Bill to:');
$pdf->Ln(10);
$pdf->Cell(70,10, $C_Fname, $C_Surname);
$pdf->Cell(80,10,'Reference No:');
$pdf->Cell(80,10,$C_Pass);
$pdf->Ln(10);
$pdf->Cell(70,10, $C_Street1);
$pdf->Cell(80,10,'Invoice Date:');
$pdf->Ln(6);
$pdf->Cell(70,10, $C_Street2);
$pdf->Ln(6);
$pdf->Cell(70,10, $C_Town);
$pdf->Ln(6);
$pdf->Cell(70,10, $C_City);
$pdf->Ln(6);
$pdf->Cell(70,10, $C_Country);
$pdf->Ln(20);
$pdf->Cell(70,10,'Hosting Ordered:');
$pdf->Ln(6);
$pdf->Cell(70,10,'Invoice Total:');
$pdf->Ln(145);
$pdf->SetTextColor(255, 165, 0);
//$pdf->Cell(70,10,'www.substanceabuseawareness.com');
$pdf->Cell(150,10,'shopping@substancebuseawareness.com');

$pdf->Output("invoice.pdf",true);

}
else {
echo "No result for the query, PDF not generated";
}

?>



any help?

thanks