title: how to control page breaks in tcpdf
body: <p>i'm generating a pdf document for an invoice using TCPDF library in yii php.
  after the address data there a part with the list of bought items. that list is of variable lenght which makes it hard to predict where the next part will render.
  and at the end there is a part with payment, taxes, shipping etc. </p>
  
  <p>i would like to know how to make that last part be unbreakable. so it's either entirely on the first page or entirely on the second page.</p>
  
  <p>is that even doable?</p>
  
  <p>in case it helps here's the code for the part in question:</p>
  
  <pre><code>$pdf-&gt;SetFont("helvetica", "", 9);
  $pdf-&gt;Cell(4,0,'Versandart','TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,"$model-&gt;versandart",'TBLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "", 6);
  $pdf-&gt;Cell(5,0.4,'Hiermit bestätige ich den Auftrag','TLR',1,'R',0,'',0, 0,'','T');
  $pdf-&gt;SetFont("helvetica", "", 9);
  $pdf-&gt;Cell(4,0,'Frachtpreis','TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,"$model-&gt;versandpreis €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;Cell(5,0,'','LR',1,'R',0,'',0, 0,'','T');
  $pdf-&gt;Cell(4,0,'Nachnahmegeb.','TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,"$model-&gt;nachnahme €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;Cell(5,0,'','LR',1,'R',0,'',0, 0,'','T');
  $pdf-&gt;Cell(4,0,'SPV-Versicherung','TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,"$model-&gt;versicherung €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "B", 6);
  $pdf-&gt;Cell(5,0.4,'Ort, Datum, Unterschrift','BLR',1,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "", 9);
  $pdf-&gt;Cell(4,0,'Nettobetrag','TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,$totalSum-($model-&gt;vat/100)*$totalSum." €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "", 6);
  $pdf-&gt;Cell(5,0.4,'Ich erkenne die AGB in der Homepage','TLR',1,'R',0,'',0, 0,'','T');
  $pdf-&gt;SetFont("helvetica", "", 9);
  $pdf-&gt;Cell(4,0,"incl. $model-&gt;vat% MwSt.",'TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,($model-&gt;vat/100)*$totalSum." €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "", 6);
  $pdf-&gt;Cell(5,0.4,'unter Kontakt nachzulesen hiermit an.','LR',1,'R',0,'',0, 0,'','T');
  $pdf-&gt;SetFont("helvetica", "", 9);
  $pdf-&gt;Cell(4,0,'Summe','TLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,$totalSum." €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "B", 6);
  $pdf-&gt;Cell(5,0.4,'','LR',1,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "", 9);
  $pdf-&gt;Cell(4,0,'zu bezahlen','TBLR',0,'L',0,'',0, 0,'','T');
  $pdf-&gt;Cell(8,0,$totalSum-$model-&gt;paymentSum." €",'BLR',0,'R',0,'',0, 0,'','B');
  $pdf-&gt;SetFont("helvetica", "B", 6);
  $pdf-&gt;Cell(5,0.4,'Ort, Datum, Unterschrift','BLR',1,'R',0,'',0, 0,'','B');
  $pdf-&gt;Ln();
  $pdf-&gt;MultiCell(4, 1, 'Hiermit bestätige ich den Auftrag', 'TLR', 'R', 0, 1, '', '', true, 0, false, true, 0, 'T');
  $pdf-&gt;MultiCell(4, 1, 'Ort, Datum, Unterschrift', 'BLR', 'R', 0, 1, '', '', true, 0, false, true, 0, 'B');
  </code></pre>