首页 文章

更新后的MPDF从5.7到6.1显示空页面

提问于
浏览
0

我制作了一个php脚本,它获取了一个网站的网址,并将网站转换为PDF . 这适用于MPDF 5.7版 . 我想将我的MPDf升级到6.1版,因为该版本更好地解释了 <li> 标签 . 我更新了我的字体,现在如果我尝试执行脚本,我会得到一个空的页面 .

New Code:

ob_start();
        include(substr($url, 1, strlen($url)-1));
        $html=ob_get_contents();
        ob_end_clean();
        require_once("mpdf61/mpdf.php");
        $mpdf = new mPDF('', 'A4', 8,'roboto');
        $mpdf->SetFooter('W&T||Seite {PAGENO}');
        $mpdf->SetHTMLHeader('<div style="text-align: right;" ><img style="height:50px;" src="/pics/head/e-logow-01-grww-000.png " ></div>');
        $mpdf->SetAutoPageBreak(true , 15);
        $mpdf->SetTopMargin(30);
        $mpdf->AddPage();
        $mpdf->list_indent_first_level = 0;
        $mpdf->WriteHTML($html);
        $mpdf->Output();

Old code:

ob_start();
        include(substr($url, 1, strlen($url)-1));
        $html=ob_get_contents();
        ob_end_clean();
        require_once("mpdf57/mpdf.php");
        $mpdf = new mPDF('', 'A4', 8,'roboto');
        $mpdf->SetFooter('W&T||Seite {PAGENO}');
        $mpdf->SetHTMLHeader('<div style="text-align: right;" ><img style="height:50px;" src="/pics/head/e-logow-01-grww-000.png " ></div>');
        $mpdf->SetAutoPageBreak(true , 15);
        $mpdf->SetTopMargin(30);
        $mpdf->AddPage();
        $mpdf->list_indent_first_level = 0;
        $mpdf->WriteHTML($html);
        $mpdf->Output();

它与另一个libary版本的代码相同 .

1 回答

相关问题