Search code examples
phplinecellfpdf

FPDF not outputting lines


I have FPDF document I am creating running into an issue with it not outputting all the cells I created. Will output up until the Print Name: line with the underlined cell.

Then will not output next lines I have multiple lines all with same parameters as Print Name: line like Dimensions: none of them print. Not sure as to why. Any help appreciated.

$pdf->SetFont('Helvetica','',12);
$pdf->Cell(189 ,5,'',0,1);
$pdf->Cell(189 ,5,'Your plate charges follow:',0,1);
$pdf->Cell(189 ,3,'',0,1);
$pdf->Cell(10 ,5,'',0,0);
$pdf->Cell(39 ,5,'Print Name:',0,0);
$pdf->Cell(140 ,5,'','B',0,1);
$pdf->Cell(10 ,5,'',0,0);
$pdf->Cell(39 ,5,'Dimensions:',0,0);
$pdf->Cell(140 ,5,'','B',0,1);

Solution

  • The 6th parameter on this line $pdf->Cell(140 ,5,'','B',0,1); is not valid. The allowed values are

    • L or empty string: left align (default value)
    • C: center
    • R: right align

    Change the 1 to one of the values shown above. Same thing for the last line in your question $pdf->Cell(140 ,5,'','B',0,1);.