|
| 1 | +diff --git a/modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php b/modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php |
| 2 | +index 3eb8e73..b6fb0dc 100755 |
| 3 | +--- a/modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php |
| 4 | ++++ b/modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php |
| 5 | +@@ -262,20 +262,20 @@ class PdfFormat extends PrintableFormatBase { |
| 6 | + /** |
| 7 | + * Return default headers (may be overridden by the generator). |
| 8 | + * |
| 9 | +- * @param string $filename |
| 10 | +- * The path to generated file that is sent to the browser. |
| 11 | ++ * @param string $filepath |
| 12 | ++ * The path to generated file that is sending to the browser. |
| 13 | + * @param bool $download |
| 14 | + * Whether to download the PDF or display it in the browser. |
| 15 | + * |
| 16 | + * @return array |
| 17 | + * Default headers for the response object. |
| 18 | + */ |
| 19 | +- private function getHeaders($filename, $download) { |
| 20 | ++ private function getHeaders($filepath, $download) { |
| 21 | + $disposition = $download ? 'attachment' : 'inline'; |
| 22 | + return [ |
| 23 | + 'Content-Type' => Unicode::mimeHeaderEncode('application/pdf'), |
| 24 | +- 'Content-Disposition' => $disposition . '; filename="' . basename($filename) . '"', |
| 25 | +- 'Content-Length' => filesize($filename), |
| 26 | ++ 'Content-Disposition' => $disposition . '; filename="' . basename($filepath) . '"', |
| 27 | ++ 'Content-Length' => filesize($filepath), |
| 28 | + 'Content-Transfer-Encoding' => 'binary', |
| 29 | + 'Pragma' => 'no-cache', |
| 30 | + 'Cache-Control' => 'must-revalidate, post-check=0, pre-check=0', |
0 commit comments