Page Break in FPDF Tamil


SetAutoPageBreak

Enables or disables the automatic page breaking mode. When enabling, the second parameter is the distance from the bottom of the page that defines the triggering limit. By default, the mode is on and the margin is 2 cm.

Parameters
  • auto- Boolean indicating if mode should be on or off.
  • margin- Distance from the bottom of the page.

$pdf -> SetAutoPageBreak(true,50);

or

$pdf -> SetAutoPageBreak('true',50);

or

$pdf -> SetAutoPageBreak('on',50);

or

$pdf -> SetAutoPageBreak('on','50');

Source Code

<?php
     require_once "fpdf/fpdf.php"; //fpdf supporting file
 
     $pdf = new FPDF('P','mm','A4');
    /*
        A4 - 210 * 297 mm
 
    */
     $pdf -> AddPage();
 
   // SetAutoPageBreak(breakmode, bottom margin)
 
  //$pdf -> SetAutoPageBreak(1,50);
  //$pdf -> SetAutoPageBreak(true,50);
  //$pdf -> SetAutoPageBreak('true',50);
  //$pdf -> SetAutoPageBreak('on',50);
    $pdf -> SetAutoPageBreak('on','50');
 
    //addFont(family,style,file)
    $pdf -> addFont('Roboto','','Roboto.php'); 
    $pdf -> SetFont('Roboto','',12);
 
    // Creating White Background. (Default background Fill  is black)
    $pdf -> SetFillColor(255, 255, 255); 
    $pdf -> SetDrawColor(0, 0, 255); // Creating Blue Bottom Border
 
 
    $pdf -> Cell(190,10,'Add Page Break','B',1,'C',true);
    $pdf -> Cell(190,5,'',0,1,'C',false);
 
    for($i=1;$i<=50;$i++) :
        $pdf -> Cell(190,7,$i,'',1);
    endfor;
 
 
    $pdf -> Output(); // Display output
?>
View Demo