Mpdf: [php 7.1] set pagesize

Created on 10 Aug 2017  路  4Comments  路  Source: mpdf/mpdf

Hi, struggling to find new documentation for mpdf for php 7.1 would like to convert my previous version to the php 7 version.
OLD way:
$mpdf = new mPDF('','', 0, '', 15, 15, 16, 16, 9, 9, 'L');
New Class config(doesnt work):
$mpdf = new \Mpdf\Mpdf('','', 0, '', 15, 15, 16, 16, 9, 9, 'L');

I assume there is a new method of setting these parameters but the docs use the old method. Can someone point me in the right direction.

Most helpful comment

You should pass the configuration in an array now! Like this:
$this->_mPDF = new \Mpdf\Mpdf(array('mode' => 'utf-8', 'format' => 'A4'));

All 4 comments

You should pass the configuration in an array now! Like this:
$this->_mPDF = new \Mpdf\Mpdf(array('mode' => 'utf-8', 'format' => 'A4'));

Thankyou @blekerfeld

You can find WIP documentation for mPDF 7.0 in the Github pages repo https://github.com/mpdf/mpdf.github.io - default development branch.

@finwe @blekerfeld Thankyou works now(using above old style)
$page_config = array(
'mode' => '',
'format' => '',
'default_font_size' => '0',
'$default_font'=> '',
'margin_left' => '15',
'margin_right'=>'15',
'margin_top' => '16',
'margin_bottom' => '16',
'margin_header'=>'9',
'margin_footer' =>'9',
'orientation' => 'L'
);
$mpdf = new \Mpdf\Mpdf($page_config);

Was this page helpful?
0 / 5 - 0 ratings

Related issues

finwe picture finwe  路  4Comments

vtulse picture vtulse  路  5Comments

maofree picture maofree  路  3Comments

BernhardBaumrock picture BernhardBaumrock  路  3Comments

jamesbarsby picture jamesbarsby  路  4Comments