The code responsible for the footer is in core/lib/pdf.lib.php, in function pdf_pagefoot(). An easy way to change the footer is to copy one of the existing pdf-modules and change the function _pagefoot() in the bottom of the file. There is the call into pdf_pagefoot() so it’s easy to overload it that way.
I added HTML support to the snippet. This way you can have more freedom with the layout, fonts, font color, etc…
$spaceAvailable = $dims['wk'] - $dims['lm'] - $dims['rm'];
// Path to text file
$filePathRoot = DOL_DOCUMENT_ROOT.'/page_footer.txt';
if (file_exists($filePathRoot)) {
$persText = file_get_contents($filePathRoot);
// Convert HTML entities
$persText = html_entity_decode($persText, ENT_QUOTES | ENT_HTML5, 'UTF-8');
} else {
$persText = "Footer contents not found";
}
// Keep position in line with original code
$pdf->SetXY($dims['lm'], -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
// Instead of MultiCell using writeHTMLCell for HTML support in TCPDF
if (method_exists($pdf, 'writeHTMLCell')) {
// set font and fontcolor for HTML content
$pdf->SetFont($this->fontfamilyname, '', 8); // you can change the font & size here
$pdf->SetTextColor(82, 74, 112); // your own color of choice
// Rendering HTML content with same dimensions as original
$pdf->writeHTMLCell($spaceAvailable, 10, $dims['lm'], -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0), $persText, 0, 1, 0, true, 'C');
} else {
// fallback to plain text if HTML is not supported
$pdf->MultiCell($spaceAvailable, 10, strip_tags($persText), 0, 'C', 0);