PHP生成PDF时,背景文字怎么去掉?
zhrn 2009-08-25 12:21:57 我在PHP程序中生成PDF文档,但是PDF文档每次都会出现一个背景文字,如:www.phplib.com这些字,如何把这些字去掉呢,下面的是原程序:
<?
try {
$p = new PDFlib();
if ($p->begin_document("", "") == 0) {
die("Error: " . $p->get_errmsg());
}
$p->begin_page_ext(595, 842, "");
$font = $p->load_font("Helvetica-Bold", "winansi", "");
$p->setfont($font, 24.0);
$p->set_text_pos(50, 700);
$p->show_xy("Hello world (PHP)!",100 , 750 );
$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;
?>
谢谢!