Please help, I am creating an invoice with FPDF in CodeIgniter, I have a problem when I use CELL, when the text exceeds the cell the text will cross the line.
and when I use MultiCell, the appearance will change.
how to solve it so that when ‘FULL NAME’ and ‘COURSE NAME’ exceed the length of the column it will automatically wrap and the other columns follow the column height of ‘full name’ and ‘course name’
error_reporting(0); // AGAR ERROR MASALAH VERSI PHP TIDAK MUNCUL
$pdf = new FPDF('p','mm', 'A4');
$pdf->AddPage();
// $pdf->Image($background, 0, 0, 210);
// setting jenis font dan posisi
$pdf->SetFont('Arial','B',15).$pdf->SetTextColor(8, 182, 201);
$pdf->Cell(0,60,'',0,1);
$pdf->Cell(0,5,'Invoice',0,1,'C');
// ATTENTION
$pdf->SetFont('Arial','',8);
$pdf->Cell(150,5,'Attention To:',0,0,'');
$pdf->Cell(50,5,'Invoice No: '.$invoice,0,1,'');
$pdf->Cell(150,5,$uni['pic_uni'],0,0,'');
$pdf->Cell(50,5,'Date: '.date('d F Y', strtotime($data['date_created'])),0,1,'');
$pdf->Cell(80,5,$uni['email_uni'],0,1,'');
$pdf->Cell(80,5,$uni['universitas'],0,1,'');
$pdf->MultiCell(60,5,$uni['alamat_uni'],0,1,'');
// TABLE HEADER
$pdf->Cell(0,8,'',0,1);
$pdf->SetFont('Arial','',8).$pdf->SetTextColor(0, 0, 0).$pdf->SetDrawColor(181, 181, 181);
$pdf->Cell(23,8,'Passport No',1,0,'C');
$pdf->Cell(40,8,'Full Name',1,0,'C');
$pdf->Cell(45,8,'Course Name',1,0,'C');
$pdf->Cell(22,8,'Intake',1,0,'C');
$pdf->Cell(33,8,'Tuition Fee / Commission',1,0,'C');
$pdf->Cell(8,8,'%',1,0,'C');
$pdf->Cell(24,8,'Total Commission',1,0,'C');
// TABLE BODY
$pdf->Cell(10,8,'',0,1);
$pdf->SetFont('Arial','',8).$pdf->SetTextColor(0, 0, 0).$pdf->SetDrawColor(181, 181, 181);
foreach ($detail as $row) {
$id_nomor_student = $row['id_nomor_student'];
$course = $this->db->query("SELECT * FROM tb_student_universitas JOIN tb_universitas ON tb_student_universitas.universitas_tujuan = tb_universitas.code_uni WHERE id_nomor_student='$id_nomor_student' ")->result_array();
$pdf->Cell(23,8,$row['nomor_passpor_student'],1,0,'C');
$pdf->Cell(40,8,$row['nama_student'],1,0,'C');
$pdf->Cell(45,8,$course[0]['universitas'],1,0,'C');
$pdf->Cell(22,8,date('F Y', strtotime($row['intake'])),1,0,'C');
$pdf->Cell(33,8,$row['tuition_fee_commission'],1,0,'C');
$pdf->Cell(8,8,$row['persen'],1,0,'C');
$pdf->Cell(24,8,$row['total_commission'],1,1,'L');
}