I have used mpdf for generating pdf from html.
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.
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 Can I remove the last blank page.?
I had the same problem. At one point I had a
which lead to the empty page. After removing it, the empty page disappeared.