0
votes

I was using the old version of TCPDF library and php 5, now I have updated my php version into 7.x. After updating php version tcpdf library through me some deprecated functions error. To avoid it I changed old tcpdf library to new tcpdf library and deprecated issues was resolved. Now Problem i am facing with Header. Before of updating php version and tcpdf it was working fine. I use following code to print Header for pdf.

$pdf->setHeaderData($ln='', $lw0=0, $ht='', $hs=$hss, $tc=array(0,0,0), $lc=array(0,0,0));  

in place of $hss i am using some html formatted code like :

$hss = '<h1> Report</h1> <table><tr><td>Report1</td></tr></table>';

When generate the pdf, it is printing html tags as it is in pdf file. How to read html tags in header? If anyone have any idea please share.

1
Do you mean $hss = '<h1> Report</h1> <table><tr><td>Report1</td></tr></table>'; works in your old TCPDF version but not in the new TCPDF version ?Ken Lee

1 Answers

0
votes

Probably will it work for you even without custom headerData? Try to remove SetHeaderData() in your code at all, in that case there will used a default header.

And/or try to change the header to be in the new way, using constants:

$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE.' Hi there!', PDF_HEADER_STRING);

Please note, that ->SetHeaderData() starts with a capital letter, PHP interpreter on linux machines might be case sensitive.