我使用 mpdf 从 html 生成 pdf。
生成的 pdf 存在一个问题,即多显示一页。如果内容在第 1 页结束,则生成 2 个页面,如果内容在第 2 页结束,则生成 3 个页面。
这是我的代码-
<?php
include("mpdf/mpdf.php");
$mpdf=new mPDF('fsalbertpro','A4','','' , 0 , 0 , 0 , 0 , 0 , 0);
$html='----'; // this variables contain all css and HTML to be shown in PDF
ob_clean(); // cleaning the buffer before Output()
$mpdf->SetDisplayMode('fullpage');
$mpdf->list_indent_first_level = 0; // 1 or 0 - whether to indent the first level of a list
$mpdf->WriteHTML($html);
$mpdf->Output();
?>
那么如何删除最后一个空白页呢?
我有同样的问题。有一次我有一个
style="page-break-after:always"
这会导致空白页面。删除后,空白页面消失了。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)