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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user