Page 1 of 1

Display chinese characters

Posted: Sun Jun 25, 2017 7:59 am
by shaunteh
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).
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();

Re: Display chinese characters

Posted: Mon Jun 26, 2017 11:32 am
by shaunteh
Problem fixed.