MPDF在最后显示一个额外的页面 [英] MPDF showing an extra page at the end

查看:299
本文介绍了MPDF在最后显示一个额外的页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have used mpdf for generating pdf from html.

存在一个问题,即此生成的pdf显示多出一页.如果内容在第1页结束,则将生成2页,如果内容在第2页结束,则将生成三页.

There is one problem that this generated pdf showing one page extra. If content is end at page 1 then it generates 2 pages and if content ends at page 2 then it generates three pages.

这是我的代码-

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

?>

然后如何删除最后一个空白页.

Then how Can I remove the last blank page.?

推荐答案

我遇到了同样的问题.有一次我有一个

I had the same problem. At one point I had a

style="page-break-after:always" 

这将导致空白页.删除后,空白页消失了.

which lead to the empty page. After removing it, the empty page disappeared.

这篇关于MPDF在最后显示一个额外的页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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