I have exported data in PDF it is working fine for me, but for one string the text is "test<5
", when i export this text in PDF it is just showing me "test" in PDF after <
sign all the text getting blank, can anyone please tell me how can i resolve this issues ? I am using HTML2PDF
for export data in PDF
$html2pdf = new HTML2PDF('P', 'A4', 'fr',true, 'UTF-8');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML('test<5');
$html2pdf->Output('e-Voucher.pdf');
You're writing to HTML, hence the writeHTML
function. In this case you want to encode the character so it can be interpreted as HTML.
One way of doing this is:
$html2pdf = new HTML2PDF('P', 'A4', 'fr',true, 'UTF-8');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML("test<5");
$html2pdf->Output('e-Voucher.pdf');
Or as Aleksandar said:
$html2pdf = new HTML2PDF('P', 'A4', 'fr',true, 'UTF-8');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML("test<5");
$html2pdf->Output('e-Voucher.pdf');
My output to both: