Php Mpdf加载一次后不工作
我目前正在尝试Mpdf,使用composer安装它,并创建了一个简单的代码。给你Php Mpdf加载一次后不工作,php,mpdf,Php,Mpdf,我目前正在尝试Mpdf,使用composer安装它,并创建了一个简单的代码。给你 <?php require_once 'vendor/autoload.php'; $mpdf = new \Mpdf\Mpdf(); $mpdf->WriteHTML("<h1 style='color:red'>Hello world!</h1>"); $mpdf->Output(); ?> 其中是它实际写入文件的部分 例如,这是html $html = '&
<?php
require_once 'vendor/autoload.php';
$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML("<h1 style='color:red'>Hello world!</h1>");
$mpdf->Output();
?>
其中是它实际写入文件的部分
例如,这是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();
$html='1!'
埃皮德
名称
薪水
年龄
1.
老虎尼克松
320800
61
';
//将文件保存到需要文件夹/文件名的位置
$mpdf->输出(“phpflow.pdf”,“F”);
//输出功能下的浏览器输出
$mpdf->Output();
您可以按照此处的完整指南操作: