Laravel & MPDF

Gimana caranya manggil/gunain library MPDF di laravel? MPDF nya sudah saya install lewat composer, terus udah ada di folder vendor...

avatar hirumayoichi
@hirumayoichi

1 Kontribusi 0 Poin

Diperbarui 6 tahun yang lalu

1 Jawaban:

Usage

The simplest usage (since version 7.0) of the library would be as follows:

 <?php

require_once __DIR__ . '/vendor/autoload.php';

$mpdf = new \Mpdf\Mpdf();
$mpdf->WriteHTML('<h1>Hello world!</h1>');
$mpdf->Output();

This will output the PDF inline to the browser as application/pdf Content-type.

source: https://github.com/mpdf/mpdf/#usage

avatar keccikun
@keccikun

364 Kontribusi 196 Poin

Dipost 6 tahun yang lalu

Login untuk ikut Jawaban