PHP code example of japseyz / pdf-renderer

1. Go to this page and download the library: Download japseyz/pdf-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/ */

    

japseyz / pdf-renderer example snippets


return [
    // Possible values are:
    // 'browsershot', 'api2pdf'
    'service' => 'browsershot'
];

 $renderer = PDFRenderer::view(
    'documents.invoice',
    [
        'client'          => $client,
    ]
);

return response($renderer->render(), 200, [
    'Content-Type'        => 'application/pdf',
    'Content-Disposition' => 'attachment; filename="invoice.pdf"',
]);
bash
php artisan vendor:publish --tag="pdf-renderer-config"