I'm using TCPDFs writeHTML to convert some html-code into a pdf. This works fine so far except that the checkmark (✓)
is converted into a questionmark instead of... well, a checkmark ;-) The PDF is created as UTF-8, but neither feeding the checkmark itself nor the hex-representation resulted in showing the correct checkmark. I tried to used the fonts Helvetica and Times, shipped with TCPDF, but both only display ?. Any idea how to get the checkmark into the PDF?
3 Answers
@Nuno answer was a huge help. For those wondering, the writeHTML
equivalent (as asked by OP) is :
<span style="font-family:zapfdingbats;">3</span>
Old post but it may help others. Use the font zapfdingbats and the number 3 or 4.
$pdf->SetFont('zapfdingbats', '', 14);
$pdf->writeHTMLCell(80, 10, 10, 9, '3', $border=1, $ln=0, $fill=0, $reseth=true, $align='', $autopadding=true);
Check the last example https://tcpdf.org/examples/example_055/
try this one
html_entity_decode('✓', ENT_XHTML,"ISO-8859-1");
-
Anyone able to get this method to work? More appealing than changing the font for every instance. I made an attempt a couple different ways, by calling this direct with the
MultiCell()
method, assigning to a variable etc... can't seem to figure it out. Commented Mar 21, 2018 at 14:39
U+2713