PHP code example of tallieutallieu / dry-pdfgen

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

    

tallieutallieu / dry-pdfgen example snippets




$app = new \Oak\Application();

$app->register([
    \Tnt\PdfGen\PdfGenServiceProvider::class,
]);

$app->bootstrap();



$pdfGenerator = $app->get(PdfGenerator::class);
$pdfGenerator->fromHtml('<strong>This is an example</strong>');

// Stream the pdf
$pdfGenerator->stream();
// or...
// ...use the pdf file contents
$contents = $pdfGenerator->output();