title: FPDF A4 Paper not print last row
body: <p>I'm trying to make printing rows on A4 paper, no matter number of rows.
  It's important that rows occupy the entire length of A4 paper (297mm).</p>
  
  <p>Example:<br/>
  So, if I want 4 rows this means that the entire length of the paper A4 is divided by 4
  and print so that four rows equally occupy the entire A4 paper.
  The problem is that the last row is printed on different paper.<br>
  I don't know why?<br>
  Does anyone have advice how to solve problem?<br/></p>
  
  <p>Here is my php code:</p>
  
  <pre><code>&lt;?php 
  
  require('fpdf/fpdf.php');
  
  class PDF extends FPDF {
  }
  
  $pdf = new PDF('P', 'mm', array(210, 297));
  
  $pdf-&gt;SetFont('Arial', '', 8);
  $pdf-&gt;AddPage();
  $widhtMM = 210;
  
  $pdf-&gt;SetMargins(0, 0, 0, 0);
  $heightMM = 295;
  
  $pdf-&gt;SetXY(0, 0);
  $marginTop = 0;
  
  $rows = 7;
  $testo = '';
  
  for($i = 0; $i &lt; $rows; $i++) {
  
      $heightMM = 297 / $rows;
  
      if ($i == 0) {
          $marginTop = 0;
      } else {
          $marginTop += $heightMM;
      }
  
      $pdf-&gt;SetXY(0, $marginTop);
      $pdf-&gt;Cell($widhtMM, $heightMM, $heightMM, 'LRTB', 0, 'L', 0);
      $pdf-&gt;Ln();
  
  }
  $pdf-&gt;Output(); 
  ?&gt;
  </code></pre>