我写了一个简单的FPDF代码,但我遇到了一个问题。FPDF跳过第一行
由于某些原因,for循环跳过第一行(单元格1,单元格2,单元格3)。
代码:
<?php
require('temp/fpdf.php');
class PDF extends FPDF
{
function Header(){
$this->SetY(0);
$this->SetFont('Arial','I',8);
$this->Cell(0,5,'Page '.$this->PageNo(),0,0,'C');
}
function Footer(){
$this->SetY(-5);
$this->SetFont('Arial','I',8);
$this->Cell(0,5,'Page '.$this->PageNo(),0,0,'C');
}
}
$pdf = new PDF();
$pdf->SetMargins(0,0,0);
$pdf->AddPage();
$pdf->SetFont('Times','',12);
for($i=0;$i<=24;$i++){
$pdf->Cell(70,30,'Printing line number '.$i,0,0,'C');
if(($i%3==0)&&($i!=0)){
$pdf->Ln();
}
}
$pdf->Output();
?>
我盯着几个小时的代码,但我无法找到答案,所以任何帮助表示赞赏。
作品,谢谢。 – Vucko 2013-04-29 20:16:01