A Laravel wrapper for wkhtmltopdf and wkhtmltoimage to generate PDFs and images from HTML.
Laravel Snappy is a Laravel package that provides a wrapper around the Snappy library (wkhtmltopdf/wkhtmltoimage) for generating PDFs and images from HTML content. It solves the problem of creating printable documents like invoices, reports, or receipts directly from Laravel views or HTML strings with a simple, fluent API.
Laravel developers who need to generate PDFs or images from HTML within their applications, such as for invoicing systems, report generation, or document printing features.
Developers choose Laravel Snappy for its seamless Laravel integration, clean facade-based API, and robust testing utilities, offering a more native Laravel experience compared to manually using wkhtmltopdf binaries.
Laravel Snappy PDF
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers a chainable interface for setting paper size, orientation, and margins, as shown in the README with methods like setPaper() and setOption(), making configuration intuitive.
Includes a PDF fake with assertions for views, content, and filenames, enabling easy integration into Laravel test suites without generating actual files.
Provides service providers and facades for Laravel and Lumen, following Laravel conventions for a native developer experience.
Supports saving to file, streaming inline, or forcing downloads with custom headers, as demonstrated in the usage examples for flexible PDF delivery.
Requires manual installation of wkhtmltopdf binaries with system dependency issues, as highlighted in the README's attention notes for vagrant and Windows users, adding setup overhead.
Relies on wkhtmltopdf's older WebKit engine, which may not fully support modern CSS features like Grid or Flexbox, and can struggle with client-side JavaScript rendering.
The README warns of conflicts with laravel-dompdf, necessitating careful management or manual facade registration when using multiple PDF packages.