dry-pdfgen uses Dompdf in the background. For more info on Dompdf check out their Github repository: https://github.com/dompdf/dompdf
composer require tallieutallieu/dry-pdfgen
<?php
$app = new \Oak\Application();
$app->register([
\Tnt\PdfGen\PdfGenServiceProvider::class,
]);
$app->bootstrap();
<?php
$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();