Making bigger Logo in header of PDF using TCPDF

2.6k views Asked by At

How can we make this logo bigger in header ? I couldn't figure either from parameters or from documentation from TCPDF. I am using this reference example .

// Logo
$image_file = K_PATH_IMAGES.'easy.jpg';
$this->Image($image_file, 120, 10, 15, '', 'JPG', '', 'T', true, 300, '', false, false, 0, false, false, false);

Your help will be appreciated!

2

There are 2 answers

0
gobo On BEST ANSWER

Basically....

public function Header() {
            // Logo
            $image_file = K_PATH_IMAGES.'easy.png';
                $this->setJPEGQuality(90);
            $this->Image($image_file, 120, 0, 50, 40, 'PNG', '', 'T', true, 300, '', false, false, 0, false, false, false);
            // Set font
            $this->SetFont('helvetica', 'B', 20);
            // Title
        // $this->Cell(0, 15, '    ', 0, false, 'C', 0, '', 0, false, 'M', 'M');
        }

if you play with Image() function's 4th and 5th parameters you can enlarge your logo

0
Sagar Parmar On

You can do

$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP-15, PDF_MARGIN_RIGHT);

AND

$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM-15);

OR

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, array(400, 300), true, 'UTF-8', false);