CodeIgniter Forums
Problem with PDF - Printable Version

+- CodeIgniter Forums (
+-- Forum: CodeIgniter 4 (
+--- Forum: CodeIgniter 4 Support (
+--- Thread: Problem with PDF (/showthread.php?tid=86063)

Problem with PDF - motoroller - 01-05-2023

I Use MPDF in CI3 thare no problem

but with CI 4 next

i do like this

$this->response->setHeader('Content-Type', 'application/pdf');
$PDF->Output("File.pdf", 'I');

In Mozilla is ok, but in Chrome, its open like PDF but when i save it save like html (nmot pdf in html just page when pdf was created)

RE: Problem with PDF - - 01-05-2023

Try Content-Disposition header

RE: Problem with PDF - motoroller - 01-05-2023

(01-05-2023, 07:14 AM) Wrote: Try Content-Disposition header

$this->response->setHeader('Content-Type', 'application/pdf');
$this->response->setHeader('Content-Disposition', 'inline;filename="file.pdf"');

BY this way browser dold me error with protocol