用php的php_pdf.dll制作PDF文件如何才能正常显示中文

我在使用php的php_pdf.dll制作PDF文件时,生成的PDF文件 英文的现实很正常
但是,中文显示就是乱码!不知道是什么原因!

请高手执教!
我使用的版本为php4.2.2 pdflib 3.0

---------------------------------------------------------------

主要是代码页问题:试一下下面的代码:

 1   
 2  
 3// 创建一个新的PDF文档句柄   
 4  
 5$pdf = PDF_new();   
 6  
 7  
 8// 打开一个文件   
 9  
10PDF_open_file($pdf, "PDFTest.pdf");   
11  
12  
13// 开始一个新页面(A4)   
14  
15PDF_begin_page($pdf, 595, 842);   
16  
17  
18// 得到并使用字体对象   
19  
20$song = PDF_findfont($pdf, "STSong-Light", "GB-EUC-H", 1);   
21  
22PDF_setfont($pdf, $song, 30);   
23  
24  
25// 输出文字   
26  
27PDF_show_xy($pdf, "输出文字",50, 750);   
28  
29PDF_show_xy($pdf, "中文", 50, 700);   
30  
31  
32// 结束一页   
33  
34PDF_end_page($pdf);   
35  
36  
37// 关闭并保存文件   
38  
39PDF_close($pdf);   
40  
Published At
Categories with Web编程
Tagged with
comments powered by Disqus