in particulars column the content is not wrapping in the cell , it overlaps with next cell.
in using fpdf library i cannot get a cell content in next line in the same cell itried multicell also
foreach ($transactions as $transaction) {
$formattedDate = date('d-m-Y', strtotime($transaction['date']));
$cellWidth =80;
$cellHeight =5;
if ($pdf->GetStringWidth($transaction['particulars']) > $cellWidth) {
$line = ceil($pdf->GetStringWidth($transaction['particulars']) / ($cellWidth - $errMargin));
} else {
$line = 10;
}
$description = '';
$bill = '';
$status = '';
if ($transaction['particulars'] === 'Payment Received') {
$description = 'Payment by';
if (!empty($transaction['payment_type'])) {
$description .= " - " . $paymentTypeResult[0]['payment_type'] ;
if (!empty($transaction['ref_no'])) {
$description .= "n Ref No: " . nl2br($transaction['ref_no']);
}
$description .= $transaction['bill_no'] ;
}
} else {
$description = $transaction['particulars'];
}
if ($transaction['particulars'] === 'Sales' || $transaction['particulars'] === ' Return') {
$bill = $transaction['bill_no'];
}
else {
$bill = '';
}
if ($transaction['payment_status'] === '2' && $transaction['particulars'] === 'Sales') {
$status = 'Cleared';
}
else if($transaction['particulars'] === 'Sales' && $transaction['payment_status'] === null ) {
$status = 'Pending';
}
$pdf->Cell(22, ($line * $cellHeight ), $formattedDate, 1);
$pdf->Cell(20,($line * $cellHeight ), $bill, 1);
$pdf->Cell(80,($line * $cellHeight ), $description, 1);
$pdf->Cell(20, ($line * $cellHeight ), $transaction['debit'], 1);
$pdf->Cell(20, ($line * $cellHeight ), $transaction['credit'], 1);
$pdf->Cell(20, ($line * $cellHeight ), $status, 1);
$pdf->Ln(); // Move to the next row
$totalDebit += floatval($transaction['debit']);
$totalCredit += floatval($transaction['credit']);
}
cell content overlaps to next cell
text wrapping is not working pls help
in case of using multicell code in fpdf then the result is
enter image description here