You are here

function theme_print_pdf_tcpdf_footer2 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_footer2()
  2. 5.3 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer2()
  3. 7.2 print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.pages.inc \theme_print_pdf_tcpdf_footer2()
  4. 7 print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer2()
  5. 5.x print_pdf/print_pdf.pages.inc \theme_print_pdf_tcpdf_footer2()

Format the TCPDF footer layout

Parameters

$pdf: current TCPDF object

See also

theme_print_pdf_tcpdf_footer2()

2 theme calls to theme_print_pdf_tcpdf_footer2()
PrintTCPDF::Footer in print_pdf/print_pdf.class.inc
PrintTCPDF::Footer in print_pdf/print_pdf.class_php4.inc

File

print_pdf/print_pdf.pages.inc, line 636

Code

function theme_print_pdf_tcpdf_footer2($pdf) {

  // Position at 1.5 cm from bottom
  $pdf
    ->writeHTMLCell(0, 15, 15, $pdf
    ->getPageHeight() - 15, $pdf->footer);
  $ormargins = $pdf
    ->getOriginalMargins();
  $pagenumtxt = t('Page !n of !total', array(
    '!n' => $pdf
      ->PageNo(),
    '!total' => $pdf
      ->getAliasNbPages(),
  ));

  // Print page number
  if ($pdf
    ->getRTL()) {
    $pdf
      ->SetX($ormargins['right']);
    $pdf
      ->Cell(0, 10, $pagenumtxt, 'T', 0, 'L');
  }
  else {
    $pdf
      ->SetX($ormargins['left']);
    $pdf
      ->Cell(0, 10, $pagenumtxt, 'T', 0, 'R');
  }
  return $pdf;
}