mPDF set Height for SetHTMLHeader

2019-05-14 14:10发布

Exist any way to set the Height of hearder when use SetHTMLHeader function?

In the first page the size by default is correct but in the next pages, the content overwrite the end part of the header.

Regards, Oscar.

标签: height mpdf
2条回答
孤傲高冷的网名
2楼-- · 2019-05-14 14:42

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

查看更多
淡お忘
3楼-- · 2019-05-14 14:54

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

查看更多
登录 后发表回答