yii php の TCPDF ライブラリを使用して請求書用の PDF ドキュメントを生成しています。住所データの後に、購入したアイテムのリストがある部分があります。そのリストは可変長であるため、次の部分がどこにレンダリングされるかを予測するのが難しくなります。最後に、支払い、税金、送料などの部分があります。
その最後の部分を壊れないようにする方法を知りたいです。最初のページに完全にあるか、2 ページ目に完全にあるかのどちらかです。
それは実行可能ですか?
問題の部分のコードは次のとおりです。
$pdf->SetFont("helvetica", "", 9);
$pdf->Cell(4,0,'Versandart','TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,"$model->versandart",'TBLR',0,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "", 6);
$pdf->Cell(5,0.4,'Hiermit bestätige ich den Auftrag','TLR',1,'R',0,'',0, 0,'','T');
$pdf->SetFont("helvetica", "", 9);
$pdf->Cell(4,0,'Frachtpreis','TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,"$model->versandpreis €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->Cell(5,0,'','LR',1,'R',0,'',0, 0,'','T');
$pdf->Cell(4,0,'Nachnahmegeb.','TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,"$model->nachnahme €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->Cell(5,0,'','LR',1,'R',0,'',0, 0,'','T');
$pdf->Cell(4,0,'SPV-Versicherung','TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,"$model->versicherung €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "B", 6);
$pdf->Cell(5,0.4,'Ort, Datum, Unterschrift','BLR',1,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "", 9);
$pdf->Cell(4,0,'Nettobetrag','TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,$totalSum-($model->vat/100)*$totalSum." €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "", 6);
$pdf->Cell(5,0.4,'Ich erkenne die AGB in der Homepage','TLR',1,'R',0,'',0, 0,'','T');
$pdf->SetFont("helvetica", "", 9);
$pdf->Cell(4,0,"incl. $model->vat% MwSt.",'TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,($model->vat/100)*$totalSum." €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "", 6);
$pdf->Cell(5,0.4,'unter Kontakt nachzulesen hiermit an.','LR',1,'R',0,'',0, 0,'','T');
$pdf->SetFont("helvetica", "", 9);
$pdf->Cell(4,0,'Summe','TLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,$totalSum." €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "B", 6);
$pdf->Cell(5,0.4,'','LR',1,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "", 9);
$pdf->Cell(4,0,'zu bezahlen','TBLR',0,'L',0,'',0, 0,'','T');
$pdf->Cell(8,0,$totalSum-$model->paymentSum." €",'BLR',0,'R',0,'',0, 0,'','B');
$pdf->SetFont("helvetica", "B", 6);
$pdf->Cell(5,0.4,'Ort, Datum, Unterschrift','BLR',1,'R',0,'',0, 0,'','B');
$pdf->Ln();
$pdf->MultiCell(4, 1, 'Hiermit bestätige ich den Auftrag', 'TLR', 'R', 0, 1, '', '', true, 0, false, true, 0, 'T');
$pdf->MultiCell(4, 1, 'Ort, Datum, Unterschrift', 'BLR', 'R', 0, 1, '', '', true, 0, false, true, 0, 'B');