现在做fpdf文档时如何添加上网站的标识,但是不被别人厌恶呢?
理所当然的是通过向fpdf中插入页眉和页脚,PHP的fpdf类库重写Header方法和Footer方法实现。
例如:
<?php
define('FPDF_FONTPATH','font/');
require_once('fpdf/fpdf.php');
class PDF extends FPDF
{
function Header()
{
$this->SetFont('Arial','B','15');
$this->Cell(80);
$this->Cell(30,10,'welcome to www.phpdo.net');
$this->Ln(20);
}
function Footer()
{
$this->SetY(-15); //叶面上的Y坐标,单位为毫米,负数表示从页面底部向上的距离
$this->SetFont('Arial','B','15');
$this->Cell(0,10,'Page -'.$this->PageNo()); //PageNo函数输出页码
}
}
$pdf = new PDF('P','mm','A4');
$pdf->Open();
$pdf->AddPage();
$pdf->SetFont('Courier','I','20');
$pdf->Cell(10,10,'www.phpdo.net');
$pdf->Output('');
?>










最新评论
再来浏览一次,上次没看懂。
:evil: 不错啊
博主的技术文章很有帮助
好文章,关注啦!谢谢博主分享
你好 来学习下
我来了哦
第一次来访留个记号
呵呵,哥们越来越勤奋了啊 :
php点点通,(www.ph
:eek: :eek: