Drupal print module footer for TCPDF
Well I spent way too long on this, but I couldn't for the life of me figure out how to add page numbers to the pdf! Something that would seem so simple. Anyway, in the end this is how I achieved it, I'm sure this is not the preferred way but after hours of searching google, trawling though the issues queue for the print module at Drupal.org and not finding an answer I did this.
Commented out the overloaded function Footer() in /sites/all/modules/print/print_pdf/print_pdf.class.inc.
So then it uses the default function in /sites/all/libraries/tcpdf/tcpdf.php
So just in case anyone thinks, oh, but you just have to copy the theme_... functions, well I tried, and it wasn't working. I'm sure I missed something simple. And I saw a note about uncommenting some code in print_pdf.class.inc. I tried that and it didn't seem to help.
$pdf = theme('print_pdf_tcpdf_footer', $pdf, $html, $font);
References:
http://drupal.org/node/306892
http://php.net/manual/en/function.preg-match.php
http://drupal.org/node/594776
http://drupal.org/node/948498
Comments