I am generating a PDF document with the FPDF
library and I could generate it, but I really do not know how to make it jump to the next line when I reach the end of the margin.
The code I have puts the elements next to each other with a separation, the first three are fine but the problem is with the fourth one since that should go down to the next line and so on.
PHP Code
<?php
include 'fpdf/fpdf.php';
$pdf = new FPDF('P','mm','A4');
$pdf->SetMargins(15,10,15);
$pdf->SetAutoPageBreak(true, 10);
$pdf->AddPage();
$pdf->SetFont('Arial','B',16);
$pdf -> Cell(50,10,'sebastian',1,1,'C');
$x = $pdf->GetX();
$y = $pdf->GetY();
$y=$y-10;
for ($i = 1; $i<=3; $i++){
$pdf->SetXY($x-150,$y);
$x = $pdf->GetX();
$y = $pdf->GetY();
$pdf -> Cell(50,10,"SEBASTIAN",1,1,'C');
}
$pdf->Output();
?>
I would greatly appreciate your help.