mPDF set Height for SetHTMLHeader

怎甘沉沦 提交于 2019-12-05 22:54:09
Oscar Fernández Arcís

Finally use this:

$this->mpdf->mPDF('utf-8','A4','','','15','15','28','18'); 

When 15=margin-left, 15=margin-right, 28=margin-top, 18=margin-bottom

And now works well. Regards, Oscar

Sarah Trees

UPDATE 2019

Since version 7 parameter set as an array:

$mpdfConfig = array(
                'mode' => 'utf-8', 
                'format' => 'A4',
                'margin_header' => 30,     // 30mm not pixel
                'margin_footer' => 10,     // 10mm
                'orientation' => 'P'    
            );
$mpdf = new \Mpdf\Mpdf($mpdfConfig);

References:

  1. https://mpdf.github.io/reference/mpdf-functions/construct.html

  2. https://mpdf.github.io/configuration/configuration-v7-x.html

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!