MPDF how can i delete the white space margin

MRTY picture MRTY · Sep 27, 2014 · Viewed 18.4k times · Source
$style='<style>@page *{
margin-top: 0cm;
margin-bottom: 0cm;
margin-left: 0cm;
margin-right: 0cm;
}</style>';

$html ='<img src="temppng/'.$_GET['memid'].'.png"  width="325.03937" height="204.094488"  `/>';   

include("MPDF54/mpdf.php");

$mpdf = new mPDF('utf-8', 'Letter', 0, '', 1, 1, 1, 1, 8, 8);
$mpdf->useAdobeCJK = true;
$mpdf->SetAutoFont(AUTOFONT_ALL);
`$mpdf->SetMargins(0);
$mpdf->WriteHTML('<pagebreak sheet-size="86mm  54mm" />');
$mpdf->WriteHTML($style);


$mpdf->WriteHTML($html);
$mpdf->WriteHTML('<tocentry content="150mm square" />')

$mpdf->DeletePages(1,1);
$mpdf->Output();

Hi,any one know how to delete the bottom white space of the pdf,here is image 'http://tinypic.com/view.php?pic=xfdixj&s=8',i want to delete the bottom white space,any one know how to do?THX

Answer

Amien picture Amien · Mar 17, 2015

Create it with 0 margins or whatever you'd like accordingly

$mpdf=new mPDF('utf-8', 'Letter', 0, '', 0, 0, 0, 0, 0, 0);




class mPDF ([ string $mode [, mixed $format [, float $default_font_size [, string $default_font [, float $margin_left , float $margin_right , float $margin_top , float $margin_bottom , float $margin_header , float $margin_footer [, string $orientation ]]]]]])