You could add new font with proper letters
$pdf->AddFont('DejaVu','','DejaVuSansCondensed.php');
$pdf->SetFont('DejaVu', '', 10, '', false);
Then in regard to FPDF
library that is used by FPDI
:
There possible encodings are:
cp1250 (Central Europe)
cp1251 (Cyrillic)
cp1252 (Western Europe)
cp1253 (Greek)
cp1254 (Turkish)
cp1255 (Hebrew)
cp1257 (Baltic)
cp1258 (Vietnamese)
cp874 (Thai)
ISO-8859-1 (Western Europe)
ISO-8859-2 (Central Europe)
ISO-8859-4 (Baltic)
ISO-8859-5 (Cyrillic)
ISO-8859-7 (Greek)
ISO-8859-9 (Turkish)
ISO-8859-11 (Thai)
ISO-8859-15 (Western Europe)
ISO-8859-16 (Central Europe)
KOI8-R (Russian)
KOI8-U (Ukrainian)
The string that was sent to pdf was in UTF-8 (it was checked by mb_detect_encoding
function) and there was a need to convert it with cp1250.
$str = iconv('UTF-8', 'cp1250', 'zazó?ci? g??l? ja?ń');
Another solution would be to try to use:
$pdf->SetFont('freeserif', '', 14, '', true);
UPDATE PRO TIP:
In case of problems with fonts - check out first if the font is installed on your linux server.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…