You are here

function views_pdf_plugin_display::render in Views PDF 7.3

Same name and namespace in other branches
  1. 6 views_pdf_plugin_display.inc \views_pdf_plugin_display::render()
  2. 7 views_pdf_plugin_display.inc \views_pdf_plugin_display::render()
  3. 7.2 plugins/views_pdf_plugin_display.inc \views_pdf_plugin_display::render()

Render the display

Overrides views_plugin_display::render

File

./views_pdf_plugin_display.inc, line 29
PDF display plugin.

Class

views_pdf_plugin_display
This class contains all the functionality of the PDF display.

Code

function render() {

  // Generall document layout
  // Set default code
  $this->view->pdf
    ->SetFont('');

  // Render the first result row to generate tokens.
  // Only field-value tokens from the first row are usable.
  if ($result0 = reset($this->view->result)) {
    $this->view->style_plugin
      ->render_fields(array(
      $result0,
    ));
  }

  // Add leading pages
  $path = $this->view->pdf
    ->getTemplatePath($this
    ->get_option('leading_template'));
  $this->view->pdf
    ->addPdfDocument($path, 'leading');

  // Set the default background template
  $path = $this->view->pdf
    ->getTemplatePath($this
    ->get_option('template'));
  $this->view->pdf
    ->setDefaultPageTemplate($path, 'main');

  // Clear the leading/succeed flag.
  $this->view->pdf
    ->addPdfDocument();

  // Render the items
  $this->view->style_plugin
    ->render();

  // Add succeed pages
  $path = $this->view->pdf
    ->getTemplatePath($this
    ->get_option('succeed_template'));
  $this->view->pdf
    ->addPdfDocument($path, 'closing');
}