soqrate/html2pdf
soqrate/html2pdf is a Laravel/PHP package for converting HTML and Blade templates into PDF documents. It provides a simple API for generating downloadable or streamable PDFs, with configurable options for page size, orientation, and styling.
dompdf/dompdf, mpdf/mpdf, tecnickcom/tcpdf, or headless Chromium via spatie/browsershot), because the core rendering is the hard part and the wrapper is cheap.Consider it only as a time-boxed spike, and only after due diligence this repository does not support:
wkhtmltopdf, you cannot reason about CSS support, font handling, page-break behavior, or the deprecation risk of the underlying binary.Look elsewhere when: this is customer-facing (invoices, contracts) or compliance-relevant. Reach for dompdf/dompdf (widest Laravel adoption, simple CSS), mpdf/mpdf (better CSS, RTL, CJK, page headers/footers), or spatie/browsershots/spatie/laravel-pdf (Chromium fidelity) depending on CSS complexity. If the package is genuinely just sugar over one of these, implement that sugar in-house — it is typically 50–150 lines of Blade rendering plus engine configuration, and you keep the upgrade path.
Revisit if: the repo gains stars, releases, a license, and an explicit statement of which engine it wraps.
To executives: We need reliable PDF export for customer documents (invoices, statements, reports). That capability is table stakes and worth building; this particular package is not the right vehicle. It has no users, no visible license or security review, and no stated underlying engine — which means it carries vendor risk without offering meaningful differentiation. Recommendation: greenlight the feature, decline this dependency. We should standardize on a widely adopted rendering engine plus a small internal wrapper we control. Expected cost is low (days, not weeks) and it protects us from an abandoned dependency in a customer-facing, legally meaningful document path.
To engineering: Treat this repo as a reference implementation at best. Confirm what it wraps and under what license before any spike. Our preferred shape is a PdfRenderer interface with a Dompdf driver for simple documents and a Browsershot/Chromium driver for CSS-heavy or branded output, selected per template. That gives us fidelity where it matters, cheap rendering where it doesn't, and a single seam to swap engines when requirements shift to RTL, CJK, or tagged PDF. Please also put user-supplied HTML behind a sanitizer and disable remote resource fetching by default — those are the real risks in this feature, not the wrapper.
To design: HTML/CSS templates become the contract between engineering and the document's visual owner. We should plan for page-break control, header/footer regions, and print-specific CSS early, because "looks right in the browser" and "looks right on A4" are different disciplines.
How can I help you explore Laravel packages today?