Open the view in browser as html page, not as pdf using DOMPDF |
Hi,
I am using Codeigniter 4, with DOMPDF. My controller works, but open the view in browser as html page, not as pdf page, I want to download the pdf. Code: public function invoice_pdf() regards:
The following code works for me:
PHP Code: $dompdf = new \Dompdf\Dompdf(); With the following pdf_view.php: PHP Code: <?php I can't tell why it is not working for you.
(04-04-2023, 01:19 AM)JustJohnQ Wrote: The following code works for me: The problem, is that, it display / view as html page in browser, but i want to a pdf file/ output.
I understand. The samples I sent you generate a PDF which is downloaded in my download folder.
Also, in Firefox setttings - Applications, PDF's are to be opened by Windows default application which is Adobe Acrobat on my system. What's in your view? (04-04-2023, 12:11 AM)nadeem14375 Wrote: Hi, Code: $dompdf->loadHtml(view('Module\Admin\Views\Reports\pay_pdf', $data)); Add Attachment true in stream, Hope this will works |
Welcome Guest, Not a member yet? Register Sign In |