脚本宝典收集整理的这篇文章主要介绍了php – FPDF在每个A4大小的页面上获取页脚的页码,脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
<?PHP require('fpdf.PHP'); $pdf = new FPDF(); $pdf->AliasNbPages(); $pdf->AddPage(); $pdf->SetFont('Arial','',16); $start_x=$pdf->GetX(); $current_y = $pdf->GetY(); $current_x = $pdf->GetX(); $cell_width = 25; $cell_height=14; $j = 20; // This value will be coming From Database so we dont kNow how many pages the report is going to be for ($i = 0; $i<$j ; $i++){ $pdf->multiCell($cell_width,$cell_height,'Hello1',1); $current_x+=$cell_width; $pdf->Ln(); } $pdf->Output(); ?>
$pdf->AddPage("P","A4");
创建一个扩展FPDF类的新类,并覆盖预定义的Footer方法.
例:
class PDF extends FPDF { function Footer() { // Go to 1.5 cm from bottom $this->SetY(-15); // Select Arial ITalic 8 $this->SetFont('Arial','I',8); // PRint centered page number $this->Cell(0,10,'Page '.$this->PageNo(),'C'); } }
以上是脚本宝典为你收集整理的php – FPDF在每个A4大小的页面上获取页脚的页码全部内容,希望文章能够帮你解决php – FPDF在每个A4大小的页面上获取页脚的页码所遇到的问题。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。