Rasoul
Rasoul

Reputation: 77

mPdf Creates a blank page

I have an html invoice that I want to convert to pdf. I used mpdf for this, but in the case of an additional page without data, how can I delete this extra page? I used the following method but it did not work.

ob_start();  
echo $html;  
$html2 = ob_get_contents();
ob_end_clean();
$mpdf->WriteHTML($html2);

This is the output : img_link

my code : link

Upvotes: 0

Views: 819

Answers (1)

Santhosh Palan
Santhosh Palan

Reputation: 47

I changed 'margin-top' from 313px to 308px and it removed the additional page.

 @page :first {
 header: html_firstpageheader;
 margin-top: 308px;
 }

Additional page issue occurs generally due to margin and padding which creates invisible content (overflow of content).

Upvotes: 1

Related Questions