I need to write Chinese in PDF documents using FPDF. I already have a source file which is the Registration form. I need to write the Chinese Name in the Source PDF.
I tried many fonts like MSJH, Code200365k, and Microsoft Yahei. But when I included those fonts, PDF will generate diamonds or question marks.
Following is my source code using Code200365k font. But it didn't work as well
<?php
use setasign\Fpdi\Fpdi;
require_once('vendor/autoload.php');
$pdf = new Fpdi();
$pdf->AddPage();
$pdf->setSourceFile("src/registration-form.pdf");
$tplId = $pdf->importPage(1);
$pdf->useTemplate($tplId, 10, 10, 200);
$pdf->AddFont('Code200365k', '', 'Code200365k.php');
$pdf->SetFont('Code200365k','',10);
$pdf->SetTextColor(255,0,0);
$pdf->SetXY(50, 59);
$pdf->Write(0, '林夕夕');
$pdf->Output();
I need to write Chinese Font in PDF file using FPDF.