Search code examples
javascriptphphtmlfpdf

FPDF - SetFillColor inside cell


I have the need to create the cell with background color, but I was using the example:

$pdf->SetFillColor(135,206,235);
$pdf->Rect(9, 52, 190, 7, 'F');

the problem with this example is that if I get a larger than expected number of lines, it does not usually fit as it is, so how can I define the color of the cell I'm using without putting XY in its location? it's possible? Original Code:

$pdf->SetFont('Arial','B',12);
$pdf->Cell(96 ,10,'RLT Resume',0,0);


Solution

  • using this code i was able to fix my problem, the terms was bad on start:

    $pdf->SetFont('PetitaBold','',12);
    $pdf->SetFillColor(70,130,180);
    $pdf->SetDrawColor(25,25,12);
    $pdf->SetTextColor(255,255,255);