Welcome Guest, Not a member yet? Register   Sign In
CI4 Dynamic DOMPDF view ,
#8

@trunky This has nothing to do with Shield.

The code below should work fine.
PHP Code:
        
          $html 
= <<<EOD
            <!DOCTYPE html>
            <html>
            <head>
                <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
                <title>Codeigniter 4.4.3</title>
            </head>
            <body>
                <div style="margin: 0 auto;display: block;width: 500px;">
                    <table width="100%" border="1">
                        <tr>
                            <td>Name:</td>
                            <td><?= 'name' ?></td>
                        </tr>
                    </table>
                </div>
            </body>
            </html>
        EOD;

        
$dompdf = new \Dompdf\Dompdf();
        
$dompdf->loadHtml($html);
        
$dompdf->render();
        
$dompdf->stream('ci443.pdf', ['Attachment' => false]); 

But on the condition that you set mode CI_ENVIRONMENT = production. Otherwise, you will receive a white file (Error
Failed to load PDF document.).


@kenjis Dompdf is one of the popular and widely used libraries. Please check if you can why there is a problem in mode development.
Reply


Messages In This Thread
CI4 Dynamic DOMPDF view , - by devBee - 07-13-2022, 03:26 AM
RE: CI4 Dynamic DOMPDF view , - by JustJohnQ - 07-13-2022, 09:12 AM
RE: CI4 Dynamic DOMPDF view , - by devBee - 07-13-2022, 09:43 PM
RE: CI4 Dynamic DOMPDF view , - by JustJohnQ - 07-15-2022, 02:08 AM
RE: CI4 Dynamic DOMPDF view , - by devBee - 07-15-2022, 05:36 AM
RE: CI4 Dynamic DOMPDF view , - by trunky - 11-14-2023, 10:55 AM
RE: CI4 Dynamic DOMPDF view , - by kenjis - 11-14-2023, 05:10 PM
RE: CI4 Dynamic DOMPDF view , - by datamweb - 11-29-2023, 04:42 AM
RE: CI4 Dynamic DOMPDF view , - by kenjis - 11-29-2023, 02:51 PM
RE: CI4 Dynamic DOMPDF view , - by datamweb - 11-29-2023, 03:06 PM
RE: CI4 Dynamic DOMPDF view , - by kenjis - 11-29-2023, 03:20 PM
RE: CI4 Dynamic DOMPDF view , - by trunky - 12-21-2023, 11:25 AM
RE: CI4 Dynamic DOMPDF view , - by kenjis - 12-21-2023, 01:57 PM
RE: CI4 Dynamic DOMPDF view , - by trunky - 12-27-2023, 06:00 AM
RE: CI4 Dynamic DOMPDF view , - by kenjis - 12-27-2023, 05:25 PM



Theme © iAndrew 2016 - Forum software by © MyBB