MPDF 在末尾显示一个额外的页面

sha*_*ank 3 php pdf mpdf

我已经使用 mpdf 从 html 生成 pdf。

有一个问题是生成的 pdf 多显示一页。如果内容在第 1 页结束,则生成 2 个页面,如果内容在第 2 页结束,则生成三个页面。

这是我的代码-

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

?>
Run Code Online (Sandbox Code Playgroud)

那么我怎样才能删除最后一个空白页。?

Vol*_*res 5

我有同样的问题。有一次我有一个

style="page-break-after:always" 
Run Code Online (Sandbox Code Playgroud)

导致空页。删除后,空白页消失了。