【发布时间】:2020-05-22 06:37:44
【问题描述】:
这是一个例子。如何添加我下载的字体。流程如何?
$pdf = new FPDI();
$pdf->AddPage();
$pdf->setSourceFile('sample source of the template.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx, 0, 0, 210);
$pdf->AddFont('japanesefontnameSample', '', 'japaneseFontsample.ttf', true);
$pdf->SetFont('japanesefontnameSample');
$pdf->SetFontSize(12);
$pdf->SetXY(20, 23);
$pdf->SetTextColor(0, 0, 0);
【问题讨论】:
-
看看this的答案。
-
成功加载字体但仍无法识别日文字体。它变成了像这样的特殊字符“ã,µãƒ‹ãƒ¼ãƒ©ã,¤ãƒ•é•'葉”。你知道我可以用于日文字符的任何 tff 字体吗?
标签: php laravel fonts cjk fpdi