Mpdf加载一次,然后不起作用 [英] Mpdf loaded once then not worked

查看:130
本文介绍了Mpdf加载一次,然后不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在尝试使用Mpdf,使用composer安装它并创建了一个简单的代码.在这里

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();
?>

成功加载一次,然后不再加载更多.我正在通过XAMPP加载它. 太感谢了.希望有人帮助我.

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

推荐答案

它实际写入文件的位置在哪里

Where is the part where it actually writes to a file

例如,这是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();

这篇关于Mpdf加载一次,然后不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆