Mpdf loaded once then not worked [closed]

♀尐吖头ヾ 提交于 2019-12-25 03:43:16

问题


I am currently trying Mpdf, installed it using composer and created a simple code. Here it is

<?php 
require_once 'vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML("<h1 style='color:red'>Hello world!</h1>");
$mpdf->Output();
?>

It successfully loaded once then it doesnt load more. I am loading it via XAMPP. Thankyou so much. Hope someone helps me.


回答1:


Where is the part where it actually writes to a file

for example, this is the html

$html = '<table width="60%" cellspacing="0">
            <thead>
                <tr>
                    <th>Empid</th>
                    <th>Name</th>
                    <th>Salary</th>
                    <th>Age</th>
                </tr>
            </thead>
            <tbody>
                <tr>
                   <td>1</td>
                   <td>Tiger Nixon</td>
                   <td>320800</td>
                   <td>61</td>
                </tr>
            </tbody>
        </table>';

//save the file put which location you need folder/filname
$mpdf->Output("phpflow.pdf", 'F');


//out put in browser below output function
$mpdf->Output();


来源:https://stackoverflow.com/questions/52540729/mpdf-loaded-once-then-not-worked

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!