Support the ongoing development of Laravel.io →
Requests Jobs Testing

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

Last updated 3 years ago.
0

please help me :(

Last updated 3 years ago.
0

anyone cant give solution ?

Last updated 3 years ago.
0

nobody?

Last updated 3 years ago.
0

Where is Header() called?

Last updated 3 years ago.
0

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.

Last updated 3 years ago.
0

Sign in to participate in this thread!

PHPverse

Your banner here too?

flexthemes flexthemes Joined 17 Apr 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.