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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With