Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dompdf Bundle Laravel Package

prezent/dompdf-bundle

A Symfony bundle that integrates the Dompdf library, letting you generate PDFs from HTML and CSS inside your Symfony applications with simple, bundle-style configuration and service access.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Verdict up front: this is the wrong artifact for the stated target. prezent/dompdf-bundle is a Symfony bundle, not a Laravel package. Its entire value proposition is registering dompdf/dompdf as a service in Symfony's DI container and exposing bundle configuration. In a Laravel context that value is approximately zero — Laravel has no bundle registration mechanism, so you would be manually instantiating Dompdf yourself, at which point the bundle is dead weight.

  • Architecture fit: Poor. The only durable dependency here is dompdf/dompdf itself, which is mature, widely used, and actively maintained. The bundle is a ~2021 thin wrapper. Adopting it means inheriting a wrapper's release cadence for a library you could depend on directly. If the actual stack is Symfony 4/5-era, the bundle is plausible but stale; if it's Laravel 9+, it does not fit at all.
  • Integration feasibility: Low effort to try (a few hours), but the trial mostly proves what is already known: register a singleton, call $dompdf->loadHtml(), ->render(), ->stream(). There is no integration surface worth the dependency. For Laravel, barryvdh/laravel-dompdf is the de facto standard (facade, config publishing, queue-friendly helpers) and wraps the same engine — this bundle offers no comparable affordance.
  • Technical risk: High concentration in maintenance, low in runtime. Specific concerns:
    • Last release 2021-02-12, 2 stars, 0 dependents — treat as unmaintained. No security patch path for the underlying dompdf advisories through the wrapper.
    • Composer constraints from the 2021 era likely pin dompdf and Symfony versions that conflict with PHP 8.2/8.3 and current framework majors. Expect composer require resolution work or forced --ignore-platform-reqs hacks.
    • dompdf's CSS support ceiling (flexbox/grid partial or absent, limited font handling, no JS) is the real product risk, not the wrapper — but the wrapper obscures which engine version you're pinned to, making rendering regressions harder to attribute.
    • Zero dependents means zero field validation: no public evidence of anyone running this in production under load.
  • Key questions to resolve before any code:
    1. Is the target stack actually Laravel, Symfony, or framework-agnostic PHP? This changes the recommendation entirely.
    2. Is dompdf the right engine at all, or is the requirement "HTML→PDF" satisfiable by headless Chrome / Gotenberg / wkhtmltopdf, which handle modern CSS and would remove the CSS-support risk class?
    3. What is the document profile — page counts, table density, image/font assets, CJK or RTL text? dompdf degrades sharply on large, table-heavy documents.
    4. What are the SLA and volume expectations (synchronous request-path vs. queued batch), and is PDF/A or accessibility tagging required (neither dompdf nor this bundle provides it)?
    5. Do we have a hard constraint (existing Symfony app, legacy code) that makes this bundle the path of least resistance? If not, it's a no.

Integration Approach

  • Stack fit: Symfony only, and only Symfony of the bundle's vintage. For Laravel, reject. For a greenfield PHP service, reject — depend on dompdf/dompdf directly. The only defensible adoption scenario is an existing Symfony application already on this bundle, where removal is a separate cleanup ticket rather than a blocker.
  • Migration path: Define an internal seam immediately — PdfRenderer interface with render(HtmlDocument): PdfBinary. Implement it with dompdf directly (or barryvdh/laravel-dompdf in Laravel) behind that interface. This costs roughly half a day and caps exit cost at "swap one class." Given the wrapper is thin and unmaintained, the exit cost is low today; formalize that with the interface so it stays low.
    • If currently on the bundle: replace the bundle registration with a hand-rolled container definition (Symfony) or a service provider binding (Laravel) that instantiates Dompdf, then delete the Composer dependency. Verify the pinned dompdf version is not held back by the bundle's constraints — expect to unlock and re-test rendering output.
  • Compatibility: Confirm PHP version support (8.1+ especially — deprecation noise and typed-property issues in 2021-era code), Symfony major alignment, and the highest dompdf release the wrapper's constraint permits. Run a rendering regression suite (visual diffs on 5–10 representative documents) before and after any version unlock. Budget for font installation and a writable temp/cache directory — the most common first-run failure.
  • Sequencing (2-week slice):
    1. Day 1–2 — decision spike. Confirm stack; produce a one-page recommendation. If Laravel, close the ticket and open one for barryvdh/laravel-dompdf or the engine choice.
    2. Day 3–4 — engine bake-off. Render the three hardest real documents through dompdf and one alternative engine. Compare fidelity, latency, peak memory. This de-risks the CSS-support question cheaply.
    3. Day 5–6 — seam + adapter. PdfRenderer interface, direct dompdf adapter, config externalized (font dir, temp dir, paper size, DPI, isRemoteEnabled).
    4. Week 2 — hardening. Async/queue path, timeouts, memory limits, asset prefetch/caching, structured logging of render duration and document size.
    5. Week 2 — rollback plan. Feature flag on the renderer binding; keep the old path live for one release cycle.

Operational Impact

  • Maintenance: The wrapper is a maintenance liability with no maintenance benefit. Owning a two-file fork of a trivial DI registration is arguably cheaper than tracking an abandoned dependency, but the cleaner move is to not adopt it. Budget near-zero ongoing cost if you depend on dompdf directly and pin it deliberately; budget recurring cost if you keep the bundle, because you will be the one patching its Composer constraints and its Symfony deprecations.
  • Support: No upstream responsiveness, no issue history worth reading, 2 stars, 0 dependents. Any incident lands entirely on our team with no community backstop. By contrast, dompdf and barryvdh/laravel-dompdf have large, searchable issue corpora — that is a real, quantifiable support-cost delta and the strongest argument against this package.
  • Scaling: dompdf is a pure-PHP renderer — CPU-bound, memory-hungry, single-document-per-process, no streaming. It does not belong on the request path at volume. Architecture should be: upload/accept request → enqueue job → worker pool sized by peak memory per document class → object storage → signed URL. Concretely, expect 100MB+ peaks on large table documents, and set worker memory_limit with headroom above your P95 document, not your P50. Scaling is horizontal worker count; there is no smarter lever. Font and asset caching on a shared volume materially cuts per-render cost.
  • Failure modes to instrument and alert on:
    • OOM / timeout on large or adversarial documents — the dominant failure. Mitigate with hard page-count and input-size caps plus a wall-clock timeout.
    • Missing fonts producing silent tofu boxes rather than an error — assert font coverage in CI with a golden-image test.
    • Remote asset fetch (images, CSS) causing long stalls or SSRF exposure if user-supplied HTML is rendered — disable remote fetch by default and prefetch to local storage.
    • CSS fidelity drift across dompdf upgrades — user-visible, support-ticket-generating, and quiet. Requires a visual-diff gate.
    • Dependency abandonment — no patch path for future dompdf CVEs through this wrapper. This is the failure mode with the worst blast radius.
    • Composer constraint deadlock when a framework or PHP upgrade lands, forcing an emergency refactor under time pressure.
  • Ramp-up: Developer-facing curve is shallow — the API is three method calls, and any PHP dev is productive in an hour. The hidden curve is the CSS support matrix and template authoring: expect 2–5 days of a developer learning what dompdf will and won't render, and ongoing template-debugging cost as document designs evolve. QA needs a visual regression harness, which is the real ramp-up investment. Net: low onboarding cost, moderate-to-high ongoing template maintenance cost — and that cost is identical whether or not this bundle is in the dependency graph, which is precisely why the bundle should not be.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route