Hindi language not displaying correctly on tcpdf

i have created below code for displaying hindi text using arial unicode font in tcpdf

$pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);


//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

$pdf->addTTFfont('fonts/ARIALUNI.TTF', 'TrueTypeUnicode', '', 32);
$pdf->SetFont('arialuni', '', 10,'false');

$txt = 'hindi text with arial unicode समृध्दि';

$pdf->Write(0, $txt, '', 0, 'L', true, 0, false, false, 0);

// ---------------------------------------------------------

//Close and output PDF document
$pdf->Output('example_038.pdf', 'I');

but it is not getting displayed properly

But in php it showing correct text.

Please tell me if there is anything wrong.


Try mPDF as an alternative. It is very good and easy to use. Here is an example of how it displays Hindi


我会尝试mpdf1.com我已经尝试过,并且它与印地语一起工作


Something could be wrong with the font.

Try replacing the following lines and trying another font:

$pdf->addTTFfont('fonts/ARIALUNI.TTF', 'TrueTypeUnicode', '', 32);
$pdf->SetFont('arialuni', '', 10,'false');
链接地址: http://www.djcxy.com/p/88670.html

上一篇: MFC使用Windows 7在CListCtrl中使用Unicode和字体问题

下一篇: 印地语在tcpdf上显示不正确