FPDF Seitenumbruch Frage

Bin ich mit PHP und FPDF generieren Sie ein PDF mit einer Liste von Elementen. Mein problem ist, wenn das item Liste geht weiter zu einem zweiten oder Dritten Seite, ich will den Namen des Elements, Menge und Beschreibung zusammen. Gerade jetzt, wird es gehen, um eine zweite Seite, aber es kann split up alle details für ein bestimmtes Element. BITTE UM HILFE!!

<?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');

?>
InformationsquelleAutor Michael | 2010-03-12
Schreibe einen Kommentar