TCPDF HTML with Special Characters displays empty PDF file

you need to change constructor, Set UTF-8 flase and change new charshet like below:

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false);

In above example, I set encoding ISO-8859-1 instead of UTF-8 and I change true to false.

Krish


before line $pdf->writeHTML

$html = utf8_decode($html);

maybe

$html = utf8_encode($html);

As already mentionned by other persons you need to change the constructor, Set UTF-8 flase and change new charshet like below:

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, false, 'ISO-8859-1', false);

Only changing this won't always prevent getting a blank page. To prevent getting a blank page: change your font type to 'helvetica' or other.

$pdf->SetFont('helvetica', '', 11, '', true);

It works!