Inside the function Header, I want to display the logo and the variable $this->test , but finally my PDF file can show the logo only.
please help. Thanks.
please help. Thanks.
Code:
require_once('../config/lang/eng.php'); require_once('../tcpdf.php'); [B]$test="test 1"; [/B] // Extend the TCPDF class to create custom Header and Footer class MYPDF extends TCPDF { //Page header public function Header() { // Logo $image_file = K_PATH_IMAGES.'logo_example.jpg'; $this->Image($image_file, 10, 10, 15, '', 'JPG', '', 'T', false, 300, '', false, false, 0, false, false, false); // Set font $this->SetFont('helvetica', 'B', 20); // Title $this->Cell(0, 15, '[B]$this->test[/B]', 0, false, 'C', 0, '', 0, false, 'M', 'M'); } } // create new PDF document $pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
Comment