slik/dompdf-bundle
Symfony bundle that integrates the Dompdf library to generate PDFs from HTML. It provides a service for rendering HTML templates into PDF documents in Symfony applications, with configurable options and straightforward setup.
Scope correction first, because it changes the decision: this is a Symfony 2 bundle, not a Laravel/PHP package in the general sense. Its entire deliverable is Symfony kernel glue — a Bundle subclass, a DI extension, and a config tree that exposes DOMPDF as $this->get('slik_dompdf'). In a Laravel codebase, none of that is loadable. Resolve this before anything else; if the estate is Laravel, the functional equivalents are barryvdh/laravel-dompdf or dompdf/dompdf bound directly in a service provider.
With that caveat, the decisions this artifact genuinely informs:
PdfRenderer interface so the engine can change (DOMPDF → headless Chrome/Browsershot → hosted API) without touching feature code.Consider it only when all of the following hold:
composer.json and is not being modernized.Look elsewhere when any of these is true:
dompdf/dompdf directly behind your own interface; for Laravel, barryvdh/laravel-dompdf. For higher fidelity, spatie/browsershot, knplabs/knp-snappy, or mpdf/mpdf (stronger CJK and page control).chroot escapes, and SSRF via external stylesheets/images. An unmaintained wrapper makes it easy to sit on a stale, unpatched core. Any adoption needs explicit chroot pinning, remote-asset disabling, and a documented upgrade path for the core library.To executives — one paragraph: We evaluated slik/dompdf-bundle for PDF generation and do not recommend adopting it. It is a very thin, essentially unmaintained wrapper around the open-source DOMPDF library, built for Symfony 2.x — a framework generation that has been end-of-life since 2018 — with negligible adoption. It offers no capability we cannot get by depending on DOMPDF directly in roughly thirty lines of our own code. The customer-facing capability (invoices, statements, export-to-PDF) is unaffected; only the packaging choice changes. Recommended path: adopt DOMPDF upstream, or a headless-Chrome renderer if design fidelity is a requirement, behind a thin internal abstraction so we can swap engines later.
To engineering — the substance:
dompdf/dompdf, which is actively maintained. The bundle's contribution is container wiring and a config tree — reproducible in an afternoon with one service provider, with full control of versions.PdfRenderer::render(string $html, array $options): string). This is the only durable design decision: it lets us migrate from DOMPDF to Browsershot when a design requirement forces the issue, without rewriting call sites.dompdf/dompdf release, set chroot to a dedicated asset directory, disable remote image/style loading, and cap input size and page count. Those controls are ours to own; the wrapper will not provide them.Bottom line: the underlying capability is worth building; this package is not worth depending on. Score it as a reference implementation to skim, not a dependency to adopt.
How can I help you explore Laravel packages today?