MPDF shows an additional page at the end

I've used mpdf to generate pdf from html.

There is one problem that this generated PDF shows one additional page. If the content ends on page 1, it generates 2 pages, and if the content ends on page 2, it generates three pages.

Here is my code -

<?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 do I delete the last blank page?

+3


source to share


1 answer


I had the same problem. At some point I had

style="page-break-after:always" 

      



which result in a blank page. After deleting it, the blank page disappeared.

+1


source







All Articles