Display chinese characters
Posted: Sun Jun 25, 2017 7:59 am
I have an inquiry on how to display chinese character using Nubuilder. I try to insert chinese.php into fpdf file, and when I run the example, chinese character can be displayed in PDF. But what should I do to display chinese character in Nubuilder report? Tq very much.
Below is the code for your reference(from fpdf.org).
Below is the code for your reference(from fpdf.org).
If you want Big5 support, call this line in your script:
$pdf->AddBig5Font();
Then you can select the font like this:
$pdf->SetFont('Big5','',20);
All styles (bold, italic and underline) are available.
For GB:
$pdf->AddGBFont();
$pdf->SetFont('GB','',20);
All usual methods (Cell(), MultiCell(), Write() and GetStringWidth()) work with these new fonts.
Ex.php
require ('chinese.php');
$pdf=new PDF_Chinese();
$pdf->AddBig5Font();
$pdf->AddPage();
$pdf->SetFont('Big5','',20);
$pdf->Write(10,'zxc123你好');
$pdf->Output();