Good afternoon everyone!
I am a newbie with FPDF and I notice a lot, I have a problem with cell and it is not filling the cell as I want and also I get a line break strong> (in a multicell that goes just below) that I do not want, can you help me?
pdf->SetXY($pdf->GetX(),$pdf->GetY());
$pdf->SetTextColor(0,0,0);
$pdf->SetFillColor(111,222,255);
$pdf->Cell(20, 0, 'Orden', 1, 1, 'L', True);
$pdf->SetXY($pdf->GetX()+20,$pdf->GetY());
$pdf->Cell(20,0,'2',1,1,'L',True);
$pdf->SetXY($pdf->GetX()+40,$pdf->GetY());
$pdf->Cell(20,0,'Tono',0,1,'L',True);
$pdf->SetXY($pdf->GetX()+60,$pdf->GetY());
$pdf->SetFillColor(0,0,255);
$pdf->Cell(22,0,'',0,1,'L',True);
$pdf->SetXY($pdf->GetX()+82,$pdf->GetY());
$pdf->Cell(20,0,'Gama',0,1,'L',True);
$pdf->SetXY($pdf->GetX()+102,$pdf->GetY());
$pdf->SetFillColor(0,0,255);
$pdf->Cell(20,0,'',0,1,'L',True);
$pdf->SetXY($pdf->GetX(),$pdf->GetY()+3);
$pdf->SetFont('Arial','B',11);
$pdf->SetWidths(array(124));
$pdf->RowOscuro(array(utf8_decode("DESCRIPCIÓN")));
RowOscuro function:
function RowOscuro($data)
{
$nb=0;
for($i=0;$i<count($data);$i++)
$nb=max($nb,$this->NbLines($this->widths[$i],$data[$i]));
$h=8*$nb;
$this->CheckPageBreak($h);
for($i=0;$i<count($data);$i++)
{
$w=$this->widths[$i];
$a=isset($this->aligns[$i]) ? $this->aligns[$i] : 'L';
$x=$this->GetX();
$y=$this->GetY();
$this->Rect($x,$y,$w,$h);
$this->SetFillColor(122,196,117); //relleno
$this->SetDrawColor(255,255,255); //borde
$this->SetTextColor(0,0,0); //letra
$this->MultiCell($w,8,$data[$i],1,$a,'true');
$this->SetXY($x+$w,$y);
}
$this->Ln($h);
}
The idea is that 6 cells would come out, from left to right they would be:
| Order | 2 | Tone | cell without text filled with blue | Range | cell without text filled with blue |