PHP code example of lara-igniter / laraigniter-dompdf

1. Go to this page and download the library: Download lara-igniter/laraigniter-dompdf 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/ */

    

lara-igniter / laraigniter-dompdf example snippets


    use Laraigniter\DomPDF\Facade\Pdf;

    $pdf = Pdf::view('emails.invoice', [
        'data' => $data
    ]);
    
    return $pdf->download('example.pdf');

    $pdf = app('dompdf.wrapper');
    $pdf->html('<h1>Example PDF</h1>');
    
    return $pdf->stream();

    return Pdf::file(public_path('emails/example.html'))
        ->save('example.pdf')
        ->stream('example.pdf');

    Pdf::html($html)->setPaper('a4', 'landscape')
        ->setWarnings(false)
        ->save('example.pdf')

    Pdf::setOption(['dpi' => 150, 'defaultFont' => 'sans-serif']);