php - FPDF page break in fpdf -
i using php , fpdf generate pdf list of items. problem is, item not goes second or third page.
i want print next block of data in 2nd page of pdf. please me. have used setautopage break()
not working.
please help!
<?php require('fpdf.php'); class pdf extends fpdf { function header() { $this->setfont('arial','b',10); $this->rect(50,30,100,30,'f'); $this->text(80,45,"3d"); $this->setxy(20,20); $this->cell(30,10,'a',1,0,'l'); $this->setxy(80,20); $this->cell(30,10,'b',1,0,'l'); $this->setxy(80,60); $this->cell(30,10,'c',1,1,'l'); $this->setxy(150,60); $this->cell(30,10,'d',1,1,'l'); } function footer() { $this->sety(-12); $this->cell(169,20,'page '.$this->pageno().'/{nb}',0,0,'c'); } $pdf=new pdf(); $pdf->addpage(); $pdf->setfont('arial','b',16); $pdf->aliasnbpages(); $pdf->output();
you need use gety , addpage purpose.
use gety current position, subtract height of document. if less 6x (you have 6 rows) multicell height, force page break using addpage.
see detailed answer here
Comments
Post a Comment