Hi everybody,
I have a problem with my script below.
My table with Foreach function write over my Footer and didn't create a new page.
How can I set a break page ?
What's wrong with my script ?
Thanks for your help !
G.Remy
##################################################
class PDF extends FPDF
{
function Header()
{
bla bla bla header............
}
function Body(){
bla bla bla Body...............
$header= array("Col1","Col2","Col3");
$this->Table($header,$_POST['data']);
}
function Table($header,$data){
$w=array(20,30,70);
for($i=0;$i<count($header);$i++)
$this->Cell($w[$i],7,$header[$i],1,0,'C');
$this->Ln(); $j=0; $num=0;
foreach($data as $val)
{
$this->Cell($w[$j],7,$val,1,0,'C');
$num++;$j++;
if ($num == count($header)){$num=0;$this->Ln();$j=0;}
}
}
function Footer()
{
bla bla bla Footer..............................
}
}
$pdf=new PDF('P','mm','A4');
$pdf->SetAutoPageBreak('true','70');
$pdf->AddPage();
$pdf->Output('DOC'.$POST['ID'].'.pdf');
###################################################