in reply to How to use Simplified Chinese word in the PDF::API2?

I've been going over and over this for quite some time now. I believe the problem has to do with textlabel. Try this instead:

$gfx->textlabel(220,690,$fnt,20,'name');

Replies are listed 'Best First'.
Re^2: How to use Simplified Chinese word in the PDF::API2?
by Anonymous Monk on Dec 13, 2014 at 10:30 UTC
    I tried this way and it worked. Need to load a customized font file for your local font.
    use PDF::API2; use Encode; # Create a blank PDF file my $pdf = PDF::API2->new(); # Add a blank page my $page = $pdf->page(); my $font = $pdf->ttfont('/tmp/stsong.ttf'); my $ustring = "欢迎进入Perl PDF的&#19990 +;界"; $ustring = decode("utf-8", $ustring); # Add some text to the page my $text = $page->text(); $text->font($font, 20); $text->translate(80, 710); $text->text($ustring); $pdf->saveas('/tmp/foo.pdf');