Is it possible to have Polish letters in TCPDF
generated PDF
=> ążźśćłó
?
I used font which work in FPDF
library named arial_ce
, but with no result:
$fontname = $pdf->addTTFfont('tcpdf/tcpdf/fonts/arial_ce.ttf', 'TrueType', '', 96);
$pdf->SetFont($fontname, '', 14, '', true);
the same result was in using DejaVuSansCondensed
font.
Delete the arial_ce.z, arial_ce.ctg.z and arial_ce.php files from your TCPDF font folder, and then change
$fontname = $pdf->addTTFfont('tcpdf/tcpdf/fonts/arial_ce.ttf', 'TrueType', '', 96);
to this:
$fontname = $pdf->addTTFfont('tcpdf/tcpdf/fonts/arial_ce.ttf');
(addTTffont doesn't overwrite an already existing font, even if you change parameters, that's why I mentioned deleting the ones already created.)
The defaults work better for this font. After doing this, I was able to use polish characters in PDFs made by TCPDF.
Edit: Oh, and of course, TCPDF should be using the same character-set that your source string is in. In my case that would be UTF-8.