aeroswat Posted January 5, 2010 Share Posted January 5, 2010 I am using a MultiCell 6 times on the same page. When it shows up it should have 3 of the same document per page. On each page there are 3 multicells on the left side and 3 on the ride side (2 per document). The MultiCell ranges in lines from 1 to 3 lines. My problem is that I need these multicell's to occupy the same amount of space no matter how many lines they fill so that I can have a uniform height per document for printing purposes. My problem here is that MultiCell's height property only seems to be the height of each line and not of the entire multicell... I have tried to create a workaround that logically should work but does not seem to be doing the job right. My workaround should calculate the number of lines it will take to create the multicell and then create a line break with a height based on that number. The code is as follows. I have pointed out the areas where I use a multicell and where my workaround's are with arrows at the beginning of the line. The part where I am performing my query of the database and my encapsulating loop is not important and therefore left out of this post. for($i=1;$i<4;$i++){ $pdf->SetFont('Times','B',14); $pdf->Cell(120,5,'Name Removed'); $pdf->Cell(80,5,'ORDER ACKNOWLEDGEMENT'); $pdf->Cell(3,5,$i); $pdf->Ln(7); $pdf->SetFont('Times','B',12); $pdf->Cell(100,0,'Name Removed'); $pdf->SetFont('Times','',12); $pdf->Cell(65,0,"Process Date: " . $res['FDateOrdered']); $pdf->Cell(50,0,"Ship Date: " . $res['FShipDate']); $pdf->Ln(5); $pdf->SetFont('Times','B',12); $pdf->Cell(100,0,"P.O. Box 698, Talladega, AL 35161"); $pdf->SetFont('Times','',12); $pdf->Cell(65,0,"Order Number: " . $res['OrderNumber']); $pdf->Cell(25,0,"Line Number: " . $res['Line']); $pdf->Ln(5); $pdf->SetFont('Times','B',12); $pdf->Cell(100,0,"Phone numbers removed"); $pdf->SetX(100); $pdf->SetFont('Times','',12); ---> $pdf->MultiCell(100,4,"Title: " . wordwrap($res['BookTitle'],60,"\n")); ---> $pdf->SetXY(0,21+(95*($i-1))); ---> $pdf->MultiCell(100,4,wordwrap($resCode['Definition'],35,"\n")); ---> $pdf->Ln(5*(ceil(strlen($resCode['Definition'])/75.00))+2); $pdf->SetX(100); $pdf->Cell(100,0,"ISBN#: " . $res['ISBNten']); $pdf->Ln(5); $pdf->Cell(70,0,$res['SchoolSystem']); $pdf->Cell(30,0,"Code: " . $res['Code']); $pdf->Cell(75,0,"Publisher: " . $res['Publisher']); $pdf->Cell(50,0,"Copyright: " . $res['Copyright']); $pdf->Ln(10); $pdf->SetX(5); $pdf->Cell(95,0,"Student: " . $res2['StudentName']); $pdf->Cell(70,0,"AIRCB#: " . $res['AIRCBNum']); $pdf->Ln(5); $pdf->SetX(10); $pdf->Cell(90,0,$res['ShipAttention']); $pdf->Cell(75,0,"Item#: " . $res['ItemNum']); $pdf->Cell(50,0,"Value: \$" . number_format($res['Cost'],2)); $pdf->Ln(5); $pdf->SetX(10); $pdf->Cell(90,0,$res['ShipName']); $pdf->Cell(40,0,"Format: " . $res['FormatNeeded']); $pdf->Cell(35,0,"Grade: " . $res['StudentGrade']); $pdf->Cell(40,0,"Record #: " . $res['OrderYearNum']); $pdf->Ln(5); $pdf->SetX(10); $pdf->Cell(90,0,$res['ShipAddress']); $pdf->SetFont('Times','I',12); $pdf->Cell(100,0,"Upon receipt of item, please sign and return."); $pdf->Ln(5); $pdf->SetX(10); $pdf->SetFont('Times','',12); $pdf->Cell(105,0,$res['ShipCity'] . ", " . $res['ShipState'] . " " . $res['ShipZip']); $pdf->Ln(5); $pdf->SetX(100); $pdf->SetFont('Times','I',12); $pdf->Cell(70,0,"Signature_________________________"); $pdf->Cell(40,0,"Date_________________"); $pdf->Ln(10); $pdf->SetFont('Times','BI',12); $pdf->Cell(220,0,"All items MUST be returned to Name Removed ASAP at the completion of each course.",0,0,'C'); $pdf->Ln(10); } Link to comment https://forums.phpfreaks.com/topic/187256-help-with-fpdf-class/ Share on other sites More sharing options...
aeroswat Posted January 5, 2010 Author Share Posted January 5, 2010 I'm dumb... my lines weren't 75 characters long. That was the problem lol so it was treating them as all 1 line Link to comment https://forums.phpfreaks.com/topic/187256-help-with-fpdf-class/#findComment-988888 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.