PHP code example of row-bloom / mpdf-renderer

1. Go to this page and download the library: Download row-bloom/mpdf-renderer 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/ */

    

row-bloom / mpdf-renderer example snippets


use RowBloom\RowBloom\Support;
use RowBloom\MpdfRenderer\MpdfRenderer;

app()->get(Support::class);
    ->registerInterpolatorDriver(MpdfRenderer::NAME, MpdfRenderer::class)

use RowBloom\RowBloom\Interpolators\PhpInterpolator;
use RowBloom\MpdfRenderer\MpdfRenderer;
use RowBloom\RowBloom\RowBloom;
use RowBloom\RowBloom\Types\Table;

app()->get(RowBloom::class)
    ->addTable(Table::fromArray([
        ['title' => 'Title3', 'body' => 'body3'],
        ['title' => 'Title4', 'body' => 'body4'],
    ]))
    ->setInterpolator(PhpInterpolator::class)
    ->setTemplate('
        <h1><?= $title