Hello,
I searched, but I didn’t find anything, so here is a little code that will help you easily add a footer to your invoice.
You must create a “pied_de_page.txt” file in the main Dolibarr folder.
Edit this file: /core/lib/pdf.lib.php
Find this line:
// Show page nb only on iso languages (so default Helvetica font)
Just above, add this code:
$largeurDisponible = $dims['wk'] - $dims['lm'] - $dims['rm'];
// Vous pouvez changer le nom du fichier ici
$cheminFichier = DOL_DOCUMENT_ROOT.'/pied_de_page.txt';
if (file_exists($cheminFichier)) {
$textePersonnalise = file_get_contents($cheminFichier);
} else {
$textePersonnalise = "Le fichier pied_de_page.txt n'est pas trouvé.";
}
$pdf->SetXY($dims['lm'], -$posy - getDolGlobalInt('PDF_FOOTER_PAGE_NUMBER_Y', 0));
$pdf->MultiCell($largeurDisponible, 10, $textePersonnalise, 0, 'C', 0);
When you add text in txt file. Line changes will also be reproduced on the footer.
I hope this helped, if you want to improve, don’t hesitate.