![]() |
Open the view in browser as html page, not as pdf using DOMPDF - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: Open the view in browser as html page, not as pdf using DOMPDF (/showthread.php?tid=87288) |
Open the view in browser as html page, not as pdf using DOMPDF - nadeem14375 - 04-04-2023 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: RE: Open the view in browser as html page, not as pdf using DOMPDF - JustJohnQ - 04-04-2023 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. RE: Open the view in browser as html page, not as pdf using DOMPDF - nadeem14375 - 04-04-2023 (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. RE: Open the view in browser as html page, not as pdf using DOMPDF - JustJohnQ - 04-04-2023 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? RE: Open the view in browser as html page, not as pdf using DOMPDF - rmcdahal - 04-04-2023 (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 |