PHP 및 FPDF를 사용하여 항목 목록이있는 PDF를 생성하고 있습니다. 내 문제는 항목 목록이 두 번째 또는 세 번째 페이지로 이동하는 경우 항목 이름, 수량 및 설명을 함께 유지하고자하는 것입니다. 지금은 두 번째 페이지로 이동하지만 특정 항목에 대한 모든 세부 정보가 분리 될 수 있습니다. 도와주세요!FPDF Page Break 질문
<?php
require_once('auth.php');
require_once('config.php');
require_once('connect.php');
$sqlitems="SELECT * FROM $tbl_items WHERE username = '" . $_SESSION['SESS_LOGIN'] . "'";
$resultitems=mysql_query($sqlitems);
require_once('pdf/fpdf.php');
require_once('pdf/fpdi.php');
$pdf =& new FPDI();
$pdf->AddPage('P', 'Letter');
$pdf->setSourceFile('pdf/files/healthform/meds.pdf');
$tplIdx = $pdf->importPage(1);
$pdf->useTemplate($tplIdx);
$pdf->SetAutoPageBreak(on, 30);
$pdf->SetTextColor(0,0,0);
$pdf->Ln(10);
while($rowsitems=mysql_fetch_array($resultitems)){
$pdf->SetFont('Arial','B',10);
$pdf->Cell(50,4,'Item Name:',0,0,'L');
$pdf->SetFont('');
$pdf->Cell(100,4,$rowsitems['itemname'],0,0,'L');
$pdf->SetFont('Arial','B',10);
$pdf->Cell(50,4,'Quantity:',0,0,'L');
$pdf->SetFont('');
$pdf->Cell(140,4,$rowsitems['itemqty'],0,1,'L');
$pdf->SetFont('Arial','B');
$pdf->Cell(50,4,'Description:',0,0,'L');
$pdf->SetFont('');
$pdf->Cell(140,4,$rowsitems['itemdesc'],0,1,'L');
}
$pdf->Output('Items.pdf', 'I');
?>
이 질문에 대한 답변을 제공하지 않습니다. 작성자의 설명을 비평하거나 요청하려면 게시물 아래에 댓글을 남겨 둡니다. 자신의 게시물에 항상 에 댓글을 달 수 있으며 충분한 평판을 얻으면 어떤 게시물에 대해서도 댓글을 달 수 있습니다. – Ghost
사실 그것은 내 경우에 해결책을 제공해주었습니다. 행이나 표에 "page-break-inside"인라인 CSS 속성을 추가하면이 행/표가 프린터 페이지로 전송되어 두 페이지에 걸쳐 확산 될 때 중단되지 않습니다. fPDF 측면에서 동적 인 것이 아니라면 적어도 하드 코드 된 수정입니다. –