Untuk membuat Report PDF dengan clas FPDF kadang kita ingin mengisi cell dengan background warna
Menggunakan function :
SetFillColor(int r [, int g, int b])
yang mana diisi dengan warna RGB.
Contoh :
$pdf = new FPDF();
$pdf->SetTitle(‘Invoice’);$pdf->AddPage();
$pdf->Ln(5);
// Set Background warna pada cell
$pdf->SetFillColor(210,221,242);
$pdf->SetFont( ‘Arial’, ‘B’, 10 );
$pdf->Cell( 185, 5, ‘Note’ ,0,1,”,true );
$pdf->SetFont( ‘Arial’, ”, 10 );// Text dalam cell
$pdf->Cell( 185, 4, ‘Upon the above fee (VAT excluded), please withhold Income Tax Art. 23 (Non Final Income Tax) at 2% (according ‘ ,0,1,”,true);
$pdf->Cell( 185, 4, ‘to Law of The Republic of Indonesia number 36 of 2008). Please send withholding Slip to us along with the payment ‘ ,0,1,”,true);
$pdf->Cell( 185, 5, ‘note’ ,0,1,”,true );
// Untuk keluaran
$pdf->output();
Akan menghasilkan :
Sumber :
http://devmanuals.com/tutorials/php/cell-with-background-fill.html