Good morning, colleagues, I need help How can I change the header color of the following report generated by TCPDF ?, I am using Codeigniter and I can not change the default color of the TCPDF header text, I appreciate your kind help, greeting.
I suppose you have to change the font in the public functions Header () and Footer () in tcpdf.php
. To find the color of the text:
$this->SetTextColor(0, 0, 0);
In the Header () and / or Footer () functions and change it to your liking.
Regarding the color of the line, find:
$this->SetLineStyle(array('width' => 0.85 / $this->k, 'cap' => 'butt', 'join' => 'miter', 'dash' => 0, 'color' => array(70, 70, 70)));
And change the set of 'colors' at the end.
Or alternatively you can do it this way too:
By extending the main class and extending only its Footer () function:
// Extienda la clase TCPDF para crear encabezado y pie de página personalizados
class MYPDF extends TCPDF
{
// Pie de página
public function Footer()
{
//establecer el color del texto
$this->SetTextColor(255,0,0);
}
}
// crear nuevo documento PDF
$pdf = new MYPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
SO Source: Change text color in header in TCPDF