PHP code example of symfgenus / mpdf-wrapper

1. Go to this page and download the library: Download symfgenus/mpdf-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

symfgenus / mpdf-wrapper example snippets


// /config/bundles.php

    [
        // ...
        Symfgenus\MpdfWrapper\MpdfWrapperBundle::class => ['all' => true],
    ];

// /config/bundles.php

    public function index(MpdfService $MpdfService)
    {
        return $MpdfService->generatePdfResponse($pdfHtml);
    }

// /config/bundles.php

    public function index(MpdfService $MpdfService)
    {
        return $pdf = $MpdfService->generatePdf($pdfHtml);
    }

// /config/bundles.php

    public function index(MpdfService $MpdfService)
    {
        $firstPdf = $MpdfService->getMpdf($argsFirst);
        $mpdf->WriteHTML($htmlFirst);
        $firstPdfFile = $mpdf->Output();

        $secondPdf = $MpdfService->getMpdf($argsSecond);
        $mpdf->WriteHTML($htmlSecond);
        $secondPdfFile = $mpdf->Output();

        return [
            $firstPdfFile,
            $secondPdfFile
        ];
    }

$this->get('symfgenus.mpdf.wrapper').
bash
$ php composer.phar