class PDF extends FPDF {
private $number;
function setNumber($number) {
$this->number = $number;
//var_dump($this->number);
}
function Header() {
// Logo
$this->Image('assets/backend/img/logo/fingerspot-black.png',10,6,30);
// Arial bold 15
$this->SetFont('Arial','B',15);
// Move to the right
$this->Cell(80);
// Title
$this->Cell(30,10,$this->number,1,0,'C');
// Line break
$this->Ln(20);
}
// Page footer
function Footer() {
// Position at 1.5 cm from bottom
$this->SetY(-15);
// Arial italic 8
$this->SetFont('Arial','I',8);
// Page number
$this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C');
}
}
public function printSop($id, $rev, $lang) {
$fpdf = new PDF();
$fpdf->AddPage();
$fpdf->setNumber('12345');
$fpdf->SetFont('Arial','B',16);
$fpdf->Cell(40,10,'Print Out SOP!');
$fpdf->Output();
exit;
}
i want set header for my pdf with number 12345, but always return null in $this->number
This is a forum man not an Immediately answer all your questions magical portal. If you need more immediate assistance perhaps you can try the IRC channel. I found them to be very helpful.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community