title: Auto page break FPDF
body: <p>This is the code im using to make a list from data i get out a database. Im using a for each loop to put all data on screen since its a variable amout of data that comes out of the database.</p>
  
  <p>Now im facing the problem that it stops when there are 38 lines of data... I have put SetAutoPageBreak(true, 10); but it does not seem to work. </p>
  
  <p>I kindly aks if someone has a possible solution.</p>
  
  <p>Thanks in forehand :) </p>
  
  <pre><code>$pdf = new FPDF('P','mm','A4');
  $pdf-&gt;addPage(); $pdf-&gt;SetFont('Arial','B',16); 
  $pdf-&gt;SetMargins(10, 10); 
  $pdf-&gt;SetAutoPageBreak(true, 10);
  
  
  // De kop
  $pdf-&gt;SetTextColor(0,0, 0);
  $pdf-&gt;Text(10, 15, "Balansformulier", TRUE);
  $pdf-&gt;Text(10, 25, "#", TRUE);
  $pdf-&gt;Text(30, 25, "Naam", TRUE);
  $pdf-&gt;Text(100, 25, "Waar", TRUE);
  $pdf-&gt;Text(154, 25, "Aanwezig?", TRUE);
  
  
  $pdf-&gt;SetFont('Arial','i',11);
  
  // horizontale waardes voor de variabelen
  $x1=30;
  $x2=100;
  $x3=160;
  
  // veritcale waardes voor de variabelen
  $y=30;
  $y2=27;
  
  // waardes voor de nummers
  $xnummer=10;
  $ynummer=30;
  $nummer=0;
  
  //Waardes voor de lijnen
  $xlijn=10;
  $ylijn=31;
  
  
  
  for($i=0; $i&lt;5; $i++){
  
  
      foreach($balans_lijst as $balans){
  
          $nummer++;
  
          $naam = $html_entities-&gt;html_ent($balans['naam']);
          $waar = $html_entities-&gt;html_ent($balans['waar']);
  
  
          $y = $y+7;
          $y2 = $y2+7;
  
          $ynummer = $ynummer+7;
  
          $ylijn = $ylijn+7;
  
  
  
          $pdf-&gt;SetXY($x1, $y);
  
  
          //Stukken erop zetten
          $pdf-&gt;Text($xnummer,$ynummer,"{$nummer}.",1,'L', TRUE);
          $pdf-&gt;Text($x1,$y,"{$naam}",1,'L', TRUE);
          $pdf-&gt;Text($x2,$y,"{$waar}",1,'L', TRUE);
          $pdf-&gt;Line($xlijn, $ylijn, 190, $ylijn);
  
          $pdf-&gt;Rect($x3, $y2, 3, 3);
  
  
  
      }
  }
  </code></pre>