Reputation: 1683
Guys how do I set the background color of a header in TCPDF?
I have tried this one. Im quite new to TCPDF sorry:
function Header () {
$this->setFillColor();
$this->Rect();
}
I ended up with no header and a brown pdf page.
Upvotes: 2
Views: 7587
Reputation: 367
You can set the fill color direct in the rect method. This example draws a green header:
public function Header() {
$this->Rect(0, 0, 2000, 20,'F',array(),array(20, 255, 100));
}
TCPDF has the best documentation in the code itself. Have a look at the rect() parameters:
Source: http://www.tcpdf.org/doc/code/classTCPDF.html#a8fc7b86c255aeb0f14d281bdaeb2015c
Upvotes: 7