Peterson Andrew
Peterson Andrew

Reputation: 243

Fill color issue in TCPDF

Im generating PDF files with TCPDF, and im setting a BG image for the page, everything works fine except fillcolor for the cell, Im writing text on to the document with WriteHTMLCell(), all attrivutes are applying for this, except fill color

$pdf->SetFillColor(240,50,20);

If I disable the BG image then it is working, I feel fill color is on bottom layer, any help to get the fill color visible will be helpful, thank you.

Upvotes: 3

Views: 4136

Answers (1)

EPB
EPB

Reputation: 4029

I'm assuming you're adding your background image with the Image method? If so, call setPageMark after you add your background image. setPageMark Doc link

For example:

$pdf->SetFillColor(240,50,20);
$pdf->Image('curry.png', 35,35, 200);
$pdf->SetPageMark();
$pdf->WriteHTMLCell(0,40,72,72,$text,0,0,true);

Will let the fill color be drawn on top of the image. You'll need to use setPageMark to render borders on top of Image's like this as well.

Upvotes: 5

Related Questions