Update classes/pdf/PDFGenerator.php

Proposal to enhance the $display parameter.

The proposal supports the true/false value, but also the 'D', 'I' and 'S' of fpdf.

The behavior of the true value is changed to 'D' instead of 'I'.
So, in fornt or back office, while cliking on a button to retrieve a PDF, the download windows is proposed instead of displaying the PDF inside the navigator.
This commit is contained in:
oleacorner
2012-11-28 13:55:08 +01:00
parent 358c0c168f
commit 6d0d0bab1f
+11 -1
View File
@@ -132,7 +132,17 @@ class PDFGeneratorCore extends TCPDF
$this->lastPage();
$output = $display ? 'I' : 'S';
if ($display === true)
$output = 'D';
elseif ($display === false)
$output = 'S';
elseif (display == 'D')
$output = 'D';
elseif (display == 'S')
$output = 'S';
else
$output = 'I';
return $this->output($filename, $output);
}