- Can I install jjalvarezl/pdfjs-viewer-bundle in a Laravel application?
- No. This is a Symfony bundle built around a Bundle subclass, a DependencyInjection extension, service definitions, and Twig templates, and it ships no Laravel service provider or package auto-discovery. Composer resolution also fails outright: v3.0.0 pins Symfony 3 components at ^3.0, which cannot co-resolve with a Laravel 10 or 11 application that requires symfony/console and symfony/http-foundation at ^6.x or ^7.x. The conflict is at the component level, so composer require fails during dependency resolution rather than at runtime.
- Which Symfony versions does this PDF.js viewer bundle support?
- Release v3.0.0 declares stability against Symfony 3, with framework-bundle, twig-bundle, and sibling constraints at ^3.0. Symfony 3 reached end of life in November 2018, and the package publishes no support statement for Symfony 4, 5, 6, or 7. Its PHP constraint also does not declare support for PHP 8.2 or 8.3.
- How do I install and configure the bundle in a Symfony application?
- You install it with Composer, enable the bundle in your kernel registration, and publish the PDF.js assets into your public web directory. Viewer behavior such as toolbar visibility, zoom, and display options is set through bundle configuration and rendered into the Twig viewer template. You then render the provided template in your own Twig view, pointing it at the PDF you want to display.
- Which version of Mozilla PDF.js is bundled with this package?
- The release notes do not state a PDF.js version, and no dependency refresh is mentioned. Given the Symfony 3 era of the bundle, the vendored build is most likely in the 1.8 to 1.10 range from 2017 to 2018, but that should be confirmed by inspecting the shipped build and web directories rather than assumed. Checking the actual version matters because it determines whether known security fixes are present.
- Is this package affected by CVE-2024-4367?
- PDF.js versions before 4.1.392, and versions before the 3.11.174 backport, are vulnerable to CVE-2024-4367, which allows arbitrary JavaScript execution from a maliciously crafted PDF when isEvalSupported is left at its default. A Symfony 3-era bundle almost certainly vendors a 1.x build, which falls inside that range. If you reuse the assets, confirm the version, upgrade PDF.js, and explicitly set isEvalSupported to false in the viewer configuration.
- How do I display a PDF inline in a Blade view without this bundle?
- The only portable parts of this package are the vendored PDF.js viewer assets and a route that serves them against a configurable file path. In Laravel that means copying the build and web directories into public/vendor/pdfjs, adding a route, and rendering a Blade view with a configuration array for viewer options. Many teams skip PDF.js entirely and use the browser's native viewer in an iframe, or add the pdfjs-dist npm package and bundle it through Vite.
- Does the package provide a Laravel service provider or config publishing?
- No. There is no ServiceProvider, no package discovery entry in composer.json, and no publishable configuration or view namespace for Laravel. Every integration point in the package is Symfony-specific: the bundle class, the DI extension, and the Twig templates. Anything you want in Laravel has to be written by hand against the underlying PDF.js assets.
- What are the Laravel-friendly alternatives for embedding PDFs?
- For simple inline display, an iframe or embed element pointed at a route that streams the file with the correct content type is enough and requires no dependency. If you need control over the toolbar, page ranges, or rendering behavior, install pdfjs-dist through npm and load it from a Blade view via Vite. Either option keeps you on a current PDF.js release and avoids the Symfony 3 constraint conflict entirely.
- How do I customize the toolbar, zoom, and display behavior of the viewer?
- The bundle exposes viewer options for toolbar visibility, zoom defaults, and display behavior, which are passed from bundle configuration into the Twig template. Because that configuration layer is Symfony-specific, a Laravel port means reimplementing it as a plain config array that you pass into a Blade view. The underlying PDF.js viewer accepts the same options regardless of which PHP framework rendered the page.
- Is jjalvarezl/pdfjs-viewer-bundle actively maintained?
- The most recent release is a framework compatibility declaration for a Symfony version that has been end of life since 2018, with no PDF.js version bump, no security advisory, and no feature work. No dependency refresh or PHP 8.2 and 8.3 support has been declared. That pattern is a strong signal of limited remaining maintenance capacity, so treat the package as stale when assessing production risk.