gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 00:06:17 31 4
gpt4 key购买 nike

我创建了以下代码,用于在 tcpdf 中使用 arial unicode 字体显示印地文文本

$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');

但是显示不正确

但在 php 中它显示正确的文本。

如果有什么问题请告诉我。

最佳答案

尝试 mPDF作为备选。它非常好并且易​​于使用。 Here is an example它如何显示印地语

关于php - 印地语无法在 tcpdf 上正确显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13524132/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com