Bertiethedog
Programmer
I am hoping someone could point me in the right direction
using FPDF sucessfully but I want a subroutine to write header information.
invoiceheader is within a file called functions.php
and the line include_once ('functions.php') is higher up the code and other functions work OK
This is the function invoiceheader
using FPDF sucessfully but I want a subroutine to write header information.
Code:
// start the adobe page
require('fpdf.php');
$pdf=new FPDF();
$pdf->AddPage();
// this line does not work
$pdf->invoiceheader($pdf,$name,$address, $date, $invno);
$pdf->Output();
invoiceheader is within a file called functions.php
and the line include_once ('functions.php') is higher up the code and other functions work OK
This is the function invoiceheader
Code:
function invoiceheader($pdf,$name,$address, $date, $invno)
{
$pdf->SetFont('Arial','BU',14);
$pdf->Image('images/letterhead.jpg',1,1,210);
// Dummy invoice Header
$pdf->setXY(13,30);
$pdf->Cell(40,10,'Dummy Invoice');
$pdf->SetFont('Arial','B',10);
// name&address
$pdf->setXY(13,40);
$pdf->Cell(40,10,$name);
$pdf->setXY(13,47);
$pdf->MultiCell(60,4.5,$address);
// date
$pdf->setxy(160,78);
$pdf->Cell(40,10,'Date');
$pdf->setXY(170,78);
$pdf->Cell(40,10,$date);
// invoice no
$pdf->setXY(160,72);
$pdf->Cell(40,10,'Invoice No');
$pdf->setXY(180,72);
$pdf->Cell(40,10,$invno);
$x = 13;
$y = 140;
// job data on the
$pdf->SetFont('Arial','BU',10);
//Header
$pdf->setXY($x,$y - 10);
$pdf->Write(10,'Job Date');
//jobno
$pdf->setXY($x + 29,$y - 10);
$pdf->Write(10,'Job No');
// description
$pdf->setXY($x + 55,$y -10 );
$pdf->Write(10,'Description');
// value
$pdf->setXY($x + 153,$y - 10);
$pdf->cell(20,10,'Value',0,1,'R');
$pdf->SetFont('Arial','B',10);
return($pdf);
}