Welcome to the nuBuilder forums!

Please register and login to view forums and other content only available to registered users.

Display chinese characters

Post Reply
shaunteh
Posts: 2
Joined: Thu Jun 01, 2017 4:10 am

Display chinese characters

Unread post 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();
shaunteh
Posts: 2
Joined: Thu Jun 01, 2017 4:10 am

Re: Display chinese characters

Unread post by shaunteh »

Problem fixed.
Post Reply