Service/MpdfService.php
public function createMpdfInstance(
        $format = 'A4',
        $fontSize = 0,
        $fontFamily = '',
        $marginLeft = 15,
        $marginRight = 15,
        $marginTop = 16,
        $marginBottom = 16,
        $marginHeader = 9,
        $marginFooter = 9,
        $orientation = 'P'
    )
    {
        if (!(is_array($format) && count($format) == 2) || !in_array(strtoupper($format), $this->getAcceptedFormats())) {
            $format = 'A4';
        }

        $constructorArgs = array(
            'utf-8',
            $this->validateFormat($format),
            (int)$fontSize,
            $fontFamily,
            (int)$marginLeft,
            (int)$marginRight,
            (int)$marginTop,
            (int)$marginBottom,
            (int)$marginHeader,
            (int)$marginFooter,
            $this->validateOrientation($orientation));

        $reflection = new \ReflectionClass('\mPDF');
        $this->mpdf = $reflection->newInstanceArgs($constructorArgs);
    }
public function createMpdfInstance(
        $format = 'A4',
        $fontSize = 0,
        $fontFamily = '',
        $marginLeft = 15,
        $marginRight = 15,
        $marginTop = 16,
        $marginBottom = 16,
        $marginHeader = 9,
        $marginFooter = 9,
        $orientation = 'P'
    )
    {
        if (!(is_array($format) && count($format) == 2) || !in_array(strtoupper($format), $this->getAcceptedFormats())) {
            $format = 'A4';
        }

        $constructorArgs = array(
            'utf-8',
            $this->validateFormat($format),
            (int)$fontSize,
            $fontFamily,
            (int)$marginLeft,
            (int)$marginRight,
            (int)$marginTop,
            (int)$marginBottom,
            (int)$marginHeader,
            (int)$marginFooter,
            $this->validateOrientation($orientation));

        $reflection = new \ReflectionClass('\mPDF');
        $this->mpdf = $reflection->newInstanceArgs($constructorArgs);
    }
Create new mPDF instance.

$mpdf = new mPDF(
'',  mode - default ''
'',  format - A4, for example, default ''
0,   font size - default 0
'',  default font family
15,  margin_left
15,  margin right
16,  margin top
16,  margin bottom
9,   margin header
9,   margin footer
'L'  L - landscape, P - portrait
);


@param string $format
@param int    $fontSize
@param string $fontFamily
@param int    $marginLeft
@param int    $marginRight
@param int    $marginTop
@param int    $marginBottom
@param int    $marginHeader
@param int    $marginFooter
@param string $orientation