HeaderCellsFillColor – Color in PDF-Header Cell

QuestionsHeaderCellsFillColor – Color in PDF-Header Cell
Mario asked 9 years ago

Hi

how do I work with HeaderCellsFillColor, with which code do I set the colour of the header cell or even of the following cells. Do I use class.TCPDF.EasyTable.php ?

Thanks and regards, Mario

1 Answers
Abu Ghufran answered 9 years ago

You can connect on_render_pdf event handler and change config.

// params are array(<function-name>,<class-object> or <null-if-global-func>)
$e["on_render_pdf"] = array("set_pdf_format", null);
$g->set_events($e);

function set_pdf_format($arr)
{
$pdf = $arr["pdf"];
$data = $arr["data"];

// $pdf->SetFont('helvetica', '', 11);
$pdf->SetHeaderCellsFillColor(30,70,99);
$pdf->SetHeaderCellsFontColor(255,255,255);
}

Code: http://hastebin.com/icajinasil.php

To test, replace code with demos/export/export-pdf.php

Your Answer

18 + 2 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?