 |
อยากจะใส่เลขหน้าในpdf ของ tcpdf โดยจำนวนหน้านั้นมาจากการqueryข้อมูล ต้องทำยังไงเหรอค่ะ .... |
|
 |
|
|
 |
 |
|
ตามนี้ครับ 
$this->Text(270,25,'Page '.$this->PageNo().'/{nb}',0,0,'C');
|
ประวัติการแก้ไข 2013-05-02 11:38:08
 |
 |
 |
 |
Date :
2013-05-02 10:53:14 |
By :
nattkhanesha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Code (PHP)
<?php
class PDF extends FPDF
{
function Footer() {
$this->SetY( -10 );
$this->SetFont('Arial','I',5);
//หมายเลขหน้า
$this->Cell(0,10, 'page '.$this->PageNo().' of tp' ,0,0,'R');
}
}
$pdf=new PDF();
$pdf->AliasNbPages( 'tp' );
$pdf->AddPage();
$pdf->SetFont('Arial','',12);
for( $i=0;$i<30;$i++ ){
$pdf->Cell(0,10,'ข้อความ. '.$i);
$pdf->Ln(20);
}
$pdf->Output();
?>
|
ประวัติการแก้ไข 2013-05-02 11:38:26 2013-05-02 11:38:37
 |
 |
 |
 |
Date :
2013-05-02 11:37:48 |
By :
nattkhanesha |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|