fpdffpdi

FPDF library not showing special characters like '✓'


Hey I try to write special characters like '✓' to FPDF and it's not work. Only normal string work. I have checkbox on the pdf and i try to fill the checkbox with '✓'.

I try it like this:

$value = iconv('UTF-8', 'windows-1255', html_entity_decode('✓')); 
$pdf->Write(0, $value);

But when i go to the pdf and the string broken and not the same. Thanks


Solution

  • This character is not included in windows-1255. You may use "ZapfDingbats" and use chr(51) or chr(52).

    $pdf->SetFont('ZapfDingbats', '', 12);
    $pdf->Write(0, chr(51));
    

    See here for a font dump of all standard fonts.