TCPDF can't show cyrillic

V.Rashkov picture V.Rashkov · Feb 2, 2012 · Viewed 7.6k times · Source

I'm trying to output cyrillic in pdf with TCPDF .

I tried using, UTF-8, Windows-1251. I had changed the Unicode to FALSE and TRUE, to test, but I'm getting only? I tried with default and with font from file, but same results, and I tried using setsubsettings, again, no result. What is wrong?

Answer

anroots picture anroots · Nov 23, 2012

Setting the font to freeserif did it for me - default/helvetica font: unreadable cyrillic characters; freeserif: readable Russian text.

// set default font subsetting mode
$pdf->setFontSubsetting(true);

// set font
$pdf->SetFont('freeserif', '', 12);

http://www.tcpdf.org/examples/example_008.phps