Background Color inside a cell is not changing in fpdf

后端 未结 2 1188
太阳男子
太阳男子 2021-01-18 22:16

Im using fpdf to generate a pdf file for my reports and Im new to this. I want to change the fill color inside a cell but whenever I reloaded the page, nothing hapeens, It s

2条回答
  •  死守一世寂寞
    2021-01-18 22:46

    Tyr something like:

    $pdf->setFillColor(230,230,230); 
    $pdf->Cell(0,10,$text,0,1,'L',1); //your cell
    

    Defines the color used for all filling operations (filled rectangles and cell backgrounds). It can be expressed in RGB components or gray scale. The method can be called before the first page is created and the value is retained from page to page.

    Take a look to the FPDF manual

提交回复
热议问题