Weave Code
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

Knp Snappy Laravel Package

knplabs/knp-snappy

Snappy is a PHP wrapper for wkhtmltopdf/wkhtmltoimage to generate PDFs, thumbnails, and snapshots from URLs or HTML. Supports Linux/macOS/Windows, configurable binaries and options, and integrates with Symfony and Laravel via community bundles.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture fit: High compatibility with Laravel via barryvdh/laravel-snappy wrapper, but introduces external binary dependency (wkhtmltopdf) that complicates deployment pipelines. Requires careful environment management for OS-specific binary compatibility.
Integration feasibility: Straightforward for Laravel projects using the official Laravel wrapper, but binary installation (via Composer or system package) must be validated across all environments (dev/staging/prod). Composer-based binaries (h4cc/wkhtmltopdf-*) have known compatibility issues on non-Debian systems.
Technical risk: Critical security exposure if --enable-local-file-access is enabled (RCE risk). wkhtmltopdf has persistent rendering bugs (page breaks, font rendering), and the package hasn't had recent updates (last stable release 2020). Dependency on wkhtmltopdf's stability (no active maintenance).
Key questions: How will binary installation be standardized across OS environments? What security controls prevent --enable-local-file-access misuse? How will wkhtmltopdf-specific rendering issues be handled? What's the plan for wkhtmltopdf security patches?

Integration Approach

Stack fit: Ideal for Laravel via barryvdh/laravel-snappy package (already tested with Laravel service container). Leverages Laravel's queue system for async PDF generation.
Migration path: Replace existing PDF libraries (e.g., Dompdf) with Snappy via Laravel wrapper. Requires:

  1. Install barryvdh/laravel-snappy
  2. Configure binary path (use Composer-based h4cc packages for simplicity)
  3. Rewrite HTML-to-PDF calls using Snappy's API
    Compatibility: Requires PHP ≥7.2 and wkhtmltopdf ≥0.12.2 (for headless mode). Laravel 8+ compatibility confirmed via wrapper. Binary compatibility issues may occur on Alpine Linux or macOS without manual fixes.
    Sequencing:
  4. Install Laravel wrapper and wkhtmltopdf via Composer
  5. Validate binary path in local/dev environment
  6. Test critical PDF generation scenarios (page breaks, fonts, security)
  7. Deploy with binary pre-installed in production (Docker or server provisioner)
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4
php-http/client-implementation
phpcr/phpcr-implementation
cucumber/gherkin-monorepo
haydenpierce/class-finder
psr/simple-cache-implementation
uri-template/tests