You are here

public function MPDF::output in Forena Reports 8

File

forena_pdf/src/FrxPlugin/Document/MPDF.php, line 92
MPDF.inc PDF document via MPDF Library @author davidmetzler

Class

MPDF
@TODO: Determine the viability of keeping this given the troubles with MPDF.

Namespace

Drupal\forena_pdf\FrxPlugin\Document

Code

public function output(&$output) {
  $http_headers = array(
    'Pragma' => 'no-cache',
    'Expires' => '0',
    'Cache-Control' => 'no-cache, must-revalidate',
    'Content-Transfer-Encoding' => 'binary',
    'Content-Type' => 'application/pdf',
  );
  foreach ($http_headers as $name => $value) {
    $value = preg_replace('/\\r?\\n(?!\\t| )/', '', $value);
    drupal_add_http_header($name, $value);
  }
  return TRUE;
}