Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wrong page number on setPage() function: 0

Tags:

php

smarty

tcpdf

My code for tcpdf is

$file_to_show_test_details = 'pdf_view_test_details.tpl';
$test_details= $smarty->fetch($file_to_show_test_details);

// Set some content to print
$html = <<<EOD
$test_details
EOD;

// set default header data
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, 'XYZ',$pdf->writeHTML($html, true, false, true, false, ''));

The function writeHTML is not working, that's why the error 'Wrong page number on setPage() function: 0' appears in the browser. Could anyone please help me to solve this issue?

like image 621
PHPLover Avatar asked Dec 16 '22 14:12

PHPLover


1 Answers

Did you try to use addPage()?

//$pdf = new PDF();

$pdf->AddPage();
like image 198
rafinskipg Avatar answered Mar 12 '23 14:03

rafinskipg