function views_pdf_plugin_row_fields::render in Views PDF 6
Same name and namespace in other branches
- 7.3 views_pdf_plugin_row_fields.inc \views_pdf_plugin_row_fields::render()
- 7 views_pdf_plugin_row_fields.inc \views_pdf_plugin_row_fields::render()
- 7.2 plugins/views_pdf_plugin_row_fields.inc \views_pdf_plugin_row_fields::render()
Renders the views.
File
- ./
views_pdf_plugin_row_fields.inc, line 16 - PDF row fields plugin provides the the fields plugin for unformatted style.
Class
- views_pdf_plugin_row_fields
- This class contains all the functionality of the field PDF style.
Code
function render($records) {
$options = $this
->option_definition();
foreach ($records as $row_index => $row) {
$this->view->row_index = $row_index;
// Header of a record
$path = $this->view->pdf
->getTemplatePath($this->options['leading_template']);
$this->view->pdf
->addPdfDocument($path);
// Set row page template
$path = $this->view->pdf
->getTemplatePath($this->options['template'], $row, $this->view);
$this->view->pdf
->setDefaultPageTemplate($path, 'row', 'row');
// Due of limitations of field renderer, we invoke them
// here and not in the field render function.
foreach ($this->view->field as $id => $field) {
$options = $this->options['formats'][$id];
$this->view->pdf
->drawContent($row, $options, $this->view, $id);
// Set or update header / footer options per row
// this ensures that we write the last record for each page
// in the cache.
$this->view->pdf
->setHeaderFooter($row, $this->options, $this->view);
}
// Footer of a record
$path = $this->view->pdf
->getTemplatePath($this->options['succeed_template']);
$this->view->pdf
->addPdfDocument($path);
// Reset the row page number
$this->view->pdf
->resetRowPageNumber();
}
}