$pdf = tFPDF();$pdf->AddPage();//添加Unicode字体(使用UTF-8) $pdf->AddFont('meera','','meera.ttf',真);$pdf->SetFont('meera',‘,14);//从文件中加载$txt =file_get_contents(’HelloWorld.txt‘)中的$txt-8字符串;$pdf->写入(8,$txt);//选择一个标准字体(使用windows-1252) $ PDF ->SetFont('meera',‘,14);$pdf->Ln(10);$pdf->写(5,该pdf的文件大小只有12 KB);$pdf->Output();?>
HelloWorld.txt
ഇംഗ്ലീഷ്
发布于 2013-12-26 17:53:26
我得到答案,使用mpdf,fpdf和tcpdf不支持。
转到https://mail.google.com/mail/u/0/?shva=1#sent/143096e2010c4a58
下载完整安装版本的mPDF v5.7 -下载(.ZIP文件12.8MB)
运行示例/example29_multilingual_autofont.php
例如:localhost/MPDF57/examples/example29_multilingual_autofont.php
发布于 2016-11-23 09:50:24
我找到了解决办法。只需下载mpdf 6.0并使用以下查询
<?php
include('mpdf.php');
$html = '
<html>
<head>
<style>
body {background-image:url(image.jpg); background-image-resize:6;}
footer {page-break-after: always;}
</style>
</head>
<body>
<p >ഇംഗ്ലീഷ്</p>
<p style="font-family:Courier New">Malayalam</p>
</body>
</html>';
$mpdf=new mPDF('ml');
$mpdf->WriteHTML($html);
$mpdf->Output();
?>https://stackoverflow.com/questions/20781358
复制相似问题