我已经使用 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)
那么我怎样才能删除最后一个空白页。?
我有同样的问题。有一次我有一个
style="page-break-after:always"
Run Code Online (Sandbox Code Playgroud)
导致空页。删除后,空白页消失了。
| 归档时间: |
|
| 查看次数: |
3379 次 |
| 最近记录: |