salva/pdfjs-bundle
Salva PDF.js Bundle integrates Mozilla PDF.js into Symfony applications, providing Twig helpers, configurable viewer assets, and a simple way to embed browser-based PDF rendering without plugins or external services. Ideal for displaying PDF documents inline.
<script> tag, a viewer container, and a worker path. That is typically under a developer-day. Treat it as a reference implementation to copy, not a dependency to adopt.Consider it only when all of the following hold:
Look elsewhere when:
pdfjs-dist directly or a maintained Laravel wrapper, and skip the bundle semantics.For executives: This is not a strategic dependency. It is a small, three-star convenience wrapper around free Mozilla technology, last meaningfully relevant for a framework that stopped receiving security updates in 2019. Adopting it as a dependency would add supply-chain risk to save well under a developer-day of work. Recommendation: do not add it to the dependency manifest. If we need in-browser PDF viewing, we vendor PDF.js ourselves with a pinned version and a documented upgrade path. Treat the package’s presence in any repository as a prompt to revisit our framework modernization plan.
For engineering: The bundle contributes asset registration and a viewer template; everything that matters is upstream PDF.js. Port the wiring — viewer container, worker source path, and asset registration — into our existing build (Vite/AssetMapper on modern Symfony, or pdfjs-dist on Laravel), pin the PDF.js version explicitly, and record it in our dependency-review list so security advisories are tracked. Do not inherit its Symfony2 constraints. If we discover it in a legacy app, leave it in place short-term if the effort to remove it exceeds the risk, but log it as tech debt tied to the framework upgrade, and confirm the bundled PDF.js version against known advisories before we ship anything that opens untrusted documents.
How can I help you explore Laravel packages today?