You are here

function theme_print_pdf_tcpdf_footer in Printer, email and PDF versions 6

Same name and namespace in other branches
  1. 5.4 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer()
  2. 5.3 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer()
  3. 7.2 print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc \theme_print_pdf_tcpdf_footer()
  4. 7 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer()
  5. 5.x print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer()

Format the TCPDF footer contents

Parameters

$pdf: current TCPDF object

$html: contents of the body of the HTML from the original node

$font: array with the font definition (font name, styles and size)

See also

theme_print_pdf_tcpdf_footer()

1 theme call to theme_print_pdf_tcpdf_footer()
_print_pdf_tcpdf in print_pdf/print_pdf.pages.inc
Generate the PDF file using the TCPDF library

File

print_pdf/print_pdf.pages.inc, line 612

Code

function theme_print_pdf_tcpdf_footer($pdf, $html, $font) {
  preg_match('!<div class="print-footer">(.*?)</div>!si', $html, $tpl_footer);
  if (isset($tpl_footer[1])) {
    $footer = trim(preg_replace('!</?div[^>]*?>!i', '', $tpl_footer[1]));

    // set footer font
    $font[2] *= 0.8;
    $pdf
      ->setFooterFont($font);

    // set footer margin
    $pdf
      ->SetFooterMargin(10);

    // set footer data
    $pdf
      ->setFooterContent($footer);
  }
  return $pdf;
}