相关疑难解决方法(0)

印地语语言在tcpdf上无法正确显示

我创建了下面的代码,用于在tcpdf中使用arial unicode字体显示hindi文本

$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');
Run Code Online (Sandbox Code Playgroud)

但它没有正确显示

但在PHP中它显示正确的文本.

请告诉我是否有任何错误.

php utf-8 tcpdf hindi

14
推荐指数
1
解决办法
4186
查看次数

标签 统计

hindi ×1

php ×1

tcpdf ×1

utf-8 ×1