tallieutallieu / dry-pdfgen
Generate PDFs using Dompdf
Installs: 38
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
pkg:composer/tallieutallieu/dry-pdfgen
Requires
- dompdf/dompdf: ^0.8.3
- tallieutallieu/oak: ^1.0 | ^1.1
This package is auto-updated.
Last update: 2025-09-18 13:49:50 UTC
README
Generate PDF-documents from HTML markup
dry-pdfgen uses Dompdf in the background. For more info on Dompdf check out their Github repository: https://github.com/dompdf/dompdf
Installation
composer require tallieutallieu/dry-pdfgen
Register the service provider
<?php $app = new \Oak\Application(); $app->register([ \Tnt\PdfGen\PdfGenServiceProvider::class, ]); $app->bootstrap();
Basic usage
<?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();