You are here

function PdfTemplate::_format_header_footer in Views PDF 7.3

2 calls to PdfTemplate::_format_header_footer()
PdfTemplate::Footer in ./views_pdf_template.php
Function override to output the footer.
PdfTemplate::Header in ./views_pdf_template.php
Function override to output the header.

File

./views_pdf_template.php, line 190
PDF Class to generate PDFs with native PHP. This class based on FPDF and FPDI.

Class

PdfTemplate
The main class to generate the PDF.

Code

function _format_header_footer($h_f) {
  $display = $this->display;

  // Get the leading/trailing header/footer option (e.g. "succeed_header").
  if ((empty($this->position) || $this->position == 'closing' || $display
    ->get_option("{$this->position}_{$h_f}")) && !empty($rendered = $display
    ->render_area("{$h_f}"))) {
    $this
      ->SetTextColorArray($display
      ->get_option("{$h_f}_font_color"));
    $this
      ->SetFont($display
      ->get_option("{$h_f}_font_family"), implode('', $display
      ->get_option("{$h_f}_font_style")), $display
      ->get_option("{$h_f}_font_size"));
    $yvar = "y_{$h_f}";
    $this
      ->writeHTMLCell(0, 0, (double) $this->lMargin, (double) $this->{$yvar}, format_string($rendered, array(
      '!page' => $this
        ->getPage(),
    )), 0, 0, FALSE, TRUE, $display
      ->get_option("{$h_f}_text_align"));
  }
  if ($h_f == 'footer' && $this->position == 'closing') {
    $this->position = 'succeed';
  }
}