steamulo/pdfjs-viewer-bundle
A PHP bundle that integrates the Mozilla PDF.js viewer into your application, letting you render PDF files directly in the browser without plugins, with configurable viewer options and straightforward template integration.
Architecture fit. The first thing a TPM needs to flag is a category mismatch: steamulo/pdfjs-viewer-bundle is a Symfony 4 bundle, not a Laravel package. It does not register a Laravel service provider, does not ship Blade views, and does not expose Laravel-style config publishing. Its entire job is to wrap Mozilla's pdf.js distribution, register the viewer assets, and inject server-side parameters (default zoom, page, theme, locale, etc.) into a Twig template. The functional surface area is small: asset registration plus a configuration object. There is no backend PDF processing, no rendering service, no persistence — it is a thin presentation-layer convenience wrapper. For a Laravel codebase this is an architectural non-fit; for a Symfony codebase it is a plausible but dated convenience.
Integration feasibility. Low for a Laravel shop. Adapting it would mean re-implementing the bundle's config schema inside a Laravel service provider, replacing Twig with Blade, and reconciling Symfony's asset pipeline (Webpack Encore / Assetic assumptions) with Vite or Laravel Mix. That is more work than simply vendoring pdfjs-dist and writing a Blade partial with a config file — roughly one to two engineer-days either way. The only thing worth harvesting is the parameter model, which can be read from the bundle source in an afternoon. There is no API, SDK, or data contract to integrate against.
Technical risk. High, concentrated in three areas. (1) Platform EOL: Symfony 4 reached end of life in November 2023 and receives no security patches; the bundle's version constraints will fight any modern Symfony or PHP upgrade. (2) Abandonment: last release January 2023, zero stars, zero dependents, single-maintainer project. There is no signal of an active consumer base, which means no one is filing issues, no one is merging fixes, and regressions would go unnoticed. (3) Transitive staleness: the pinned pdf.js build is likely several major versions behind, and pdf.js has a history of security-relevant parsing fixes; an old viewer bundled into a customer-facing document surface is a real exposure. License is Apache-2.0, which is permissive and clean — legal/procurement is the one dimension with no friction.
Key questions to resolve before any decision.
pdfjs-dist package plus <50 lines of glue?Stack fit. Poor as-is. Symfony bundles rely on Bundle classes, DI extension classes, and Twig namespaces — none of which Laravel's container or view layer consumes. The realistic options are: (a) fork and port to a Laravel package with a service provider, config file, and Blade component; (b) skip the package entirely and integrate pdfjs-dist directly; (c) adopt only if the host application is genuinely Symfony 4/5, which contradicts the stated Laravel context.
Migration path. The recommended path is (b) with a light borrow from the bundle. Concretely: install pdfjs-dist via npm, copy the viewer shell into a Blade partial, expose viewer defaults through config/pdfjs.php and a @php / view-composer injection, and serve the assets through Vite with a long-lived cache header. If a package-shaped abstraction is genuinely wanted, wrap that in an internal Composer package — you get the same ergonomics, on a supported platform, with pdf.js you can patch.
Compatibility. Assume hard limits: Symfony 4/5 only, Twig required, PHP constraints aligned to the 2023-era release. It will not coexist cleanly with Laravel's Blade, Vite, or its config repository. There is no published compatibility matrix and zero dependents to infer one from, so any compatibility claim is unverified until spiked.
Sequencing. (1) One-day spike: read the bundle source, extract the parameter schema, confirm what "customizable parameters on server side" actually means in practice. (2) Confirm the product requirement is real rather than inferred. (3) Build the direct pdfjs-dist integration in the Laravel app, using the extracted schema as the config design. (4) Only if a second Symfony-based consumer appears should packaging be considered — and even then, target a maintained Symfony LTS. Do not sequence this as "adopt bundle, then adapt"; the adaptation cost exceeds the build cost.
Maintenance. Effectively zero upstream. The project shows no release activity since January 2023 and no dependents, meaning the maintenance burden transfers entirely to whoever adopts it. Budget for owning a fork: tracking pdf.js security releases, re-vendoring assets, and patching Twig/asset-pipeline breakage on every framework upgrade. That is a recurring cost against a component that delivers configuration plumbing.
Support. No commercial backing, no vendor SLA, no meaningful community to escalate to. Internal engineers will be reading Symfony bundle internals to answer basic questions — a poor use of senior time and a bus-factor risk if the one person who understood it leaves.
Scaling. The least concerning dimension. The bundle contributes static JS/CSS and a server-rendered parameter block; all heavy lifting (parsing, rendering, text layer) happens client-side in the browser. Assets are trivially CDN-cacheable and the server-side path adds negligible load. Scaling risk is really client risk: large PDFs will stress low-end devices, and an outdated pdf.js will handle them worse than current releases.
Failure modes. (1) Stale pdf.js parser exposed to untrusted PDFs — the highest-severity failure. (2) Framework upgrade blocked by Symfony 4 constraints, forcing an emergency rewrite under deadline. (3) Asset pipeline drift as the host app moves to Vite and the bundle assumes Encore-style output. (4) Silent breakage with no upstream issue tracker activity to surface it. (5) CDN dependency if the viewer is not self-hosted, introducing an availability and privacy failure mode for document content.
Ramp-up. Deceptively steep for the value delivered. An engineer must understand Symfony bundle conventions, Twig namespacing, and pdf.js viewer configuration to operate this — three domains — to obtain what is fundamentally a settings passthrough. Direct pdf.js integration requires understanding one domain (pdf.js) and is well-documented upstream.
TPM verdict. Do not adopt. This is a low-signal, abandoned, Symfony-4-only wrapper around a commodity open-source library, landing in a Laravel context where it structurally does not fit. The correct move is to harvest the parameter schema during a short spike and implement pdf.js directly, keeping the dependency surface current, patched, and owned by the team that operates it.
How can I help you explore Laravel packages today?