2
이 종류의 pdf를 생성하려고하는데 첫 페이지에서 모든 것이 정상입니다.FPDF PHP에서 SetXY()를 사용하여 새 페이지에서 셀 시작
그러나 때 페이지 나누기 새 페이지에 Cell()
시작 I 루프 더 다음 23 번을 보이는 경우.
나는 첫 페이지처럼 표시하려면이 셀() 할 수 있습니다. 모든 솔루션은 높게 평가 될 것이다
class PDF extends FPDF {
public $hPosX;
public $hPosY;
function FancyTable() {
$this->SetFillColor(255,0,0);
$this->SetTextColor(255,0,0);
$this->SetDrawColor(128,0,0);
$this->SetLineWidth(.3);
$this->SetFont('','B');
$this->headerTable();
}
public function headerTable(){
$this->hPosX = 15;
$this->hPosY = 3;
$this->SetFillColor(255,0,0);
$this->SetTextColor(255);
$this->SetDrawColor(128,0,0);
$this->SetLineWidth(.3);
$this->SetFont('','B');
for($i=0; $i<30;$i++){
if($this->GetX() > 160){
$this->hPosX = 15;
$this->hPosY += 35;
}
$this->SetXY($this->hPosX,$this->hPosY);
$this->Cell(50,5,'Header'.$i,1,0,'L',true);
$this->hPosX += 55;
}
}
}
$pdf = new PDF();
$pdf->SetTopMargin(10);
$pdf->SetFont('Arial','',14);
$pdf->AddPage();
$pdf->FancyTable();
$pdf->Output();
:
여기 내 코드입니다.