| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1353 人关注过本帖
标题:百度都查烂了,没有解决..
只看楼主 加入收藏
运行中
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-8-28
收藏
 问题点数:0 回复次数:0 
百度都查烂了,没有解决..

我使用的是php5+Apache2+PDFlib-6.0.2-Windows

问题1:以下例子有什么错误,为什么显示中文乱码? <?php try { $p = new PDFlib(); if ($p->begin_document("", "") == 0) { die("Error: " . $p->get_errmsg()); } $p->set_parameter("hypertextencoding", "winansi"); $p->set_info("Creator", "hello.php"); $p->set_info("Author", "Rainer Schaaf"); $p->set_info("Title", "Hello world (PHP)!"); $p->begin_page_ext(595, 842, ""); $font = $p->load_font("STSong-Light", "winansi", ""); $p->setfont($font, 24.0); $p->set_text_pos(50, 700); $p->show("Hello 中文!"); $p->continue_text("(says PHP)"); $p->end_page_ext(""); $p->end_document(""); $buf = $p->get_buffer(); $len = strlen($buf); header("Content-type: application/pdf"); header("Content-Length: $len"); header("Content-Disposition: inline; filename=hello.pdf"); print $buf; } catch (PDFlibException $e) { die("PDFlib exception occurred in hello sample:\n" . "[" . $e->get_errnum() . "] " . $e->get_apiname() . ": " . $e->get_errmsg() . "\n"); } catch (Exception $e) { die($e); } $p = 0; ?>

问题2: <?php // 创建一个新的PDF文档句柄 try{ $pdf = PDF_new(); // 打开一个文件 PDF_open_file($pdf,"htlm.pdf"); // 开始一个新页面(A4) PDF_begin_page($pdf, 595, 842); // 得到并使用字体对象 $song = PDF_findfont($pdf, "STSong-Light", "GB-EUC-H", 1); PDF_setfont($pdf, $song, 30); // 输出文字 PDF_show_xy($pdf, "输出文字",50, 750); PDF_show_xy($pdf, "中文", 50, 700); // 结束一页 PDF_end_page($pdf); // 关闭并保存文件 PDF_close($pdf); } ?> 我使用这个类型的例子,结果却什么也不显示,上面的例子至少还显示中文~~. 在线等~~~请大家看在国际人道主义精神的份上帮帮我,困饶我好一阵子了...

搜索更多相关主题的帖子: 百度 set info begin 
2005-09-07 12:24
快速回复:百度都查烂了,没有解决..
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014148 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved