Easily create PDF and images in Symfony by converting html using webkit
1.2k
Stars
142
Forks
1
Open issues
30
Contributors
AI Analysis
KnpSnappyBundle is a Symfony bundle that wraps the Snappy PHP library to convert HTML to PDF and images using the wkhtmltopdf/wkhtmltoimage webkit-based utilities. It serves developers building Symfony applications who need server-side document generation capabilities. Not suitable for applications requiring modern JavaScript rendering or for teams avoiding external binary dependencies.
Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.
AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.
Symfony wrapper for wkhtmltopdf: stable PDF/image generation with webkit rendering
KnpSnappyBundle is a Symfony integration layer for the Snappy library, which wraps the wkhtmltopdf command-line tool. It enables Symfony developers to generate PDFs and images from HTML using webkit rendering. The bundle targets projects that need reliable HTML-to-PDF conversion without pure-PHP rendering overhead. Adoption appears concentrated within the Symfony ecosystem, particularly among projects requiring complex HTML layouts or JavaScript compatibility.
Created in 2010 by KnpLabs, the bundle emerged as wkhtmltopdf gained traction. It has remained relatively stable as a lightweight Symfony integration layer, with the underlying Snappy library (4,472 stars) receiving more visibility. The project reflects an era when webkit-based PDF conversion was a standard approach before headless browser alternatives proliferated.
Growth has been modest and plateaued. The 1,244 stars suggest niche adoption rather than explosive growth. Zero stars gained in the last 7 days and a push history showing maintenance rather than feature expansion indicate a mature, stabilized project serving an existing user base rather than expanding into new segments.
Adoption not verified. No public data on production deployments, user counts, or organizational adoption. The Snappy library (parent project) has higher visibility (4,472 stars) and likely serves as the primary measure of ecosystem adoption. Bundle-specific usage metrics are unavailable.
Based on README, the bundle provides a thin wrapper around Snappy (which wraps wkhtmltopdf), exposing two DI services: `knp_snappy.image` and `knp_snappy.pdf`. It handles Symfony configuration, temporary folder management, process timeouts, and response classes (PdfResponse, JpegResponse). Appears to be primarily a service registration and configuration orchestration layer rather than core conversion logic.
Not documented in README. Build and code quality badges (Scrutinizer, StyleCI) are present, suggesting CI/CD is active, but test coverage metrics are not disclosed.
Last push 2026-01-07 (6 months before evaluation date) shows ongoing maintenance. README explicitly states KnpLabs is seeking maintainers, indicating awareness of maintenance burden. No evidence of urgent bugs or stalled issues, but the call for maintainers suggests capacity concerns for a project nearing 16 years old.
ADOPT IF: You are a Symfony project requiring reliable HTML-to-PDF conversion with complex CSS/layout support, and your deployment environment already permits system binaries (wkhtmltopdf/wkhtmltoimage). AVOID IF: You need strong ES6/modern JavaScript rendering, prefer pure-PHP solutions to avoid system dependencies, or are building greenfield projects where headless browser alternatives are feasible. MONITOR IF: You depend on this bundle and rely on active maintenance — the maintainer call suggests capacity concerns; consider evaluating headless browser alternatives (Puppeteer) or pure-PHP options (dompdf) as contingency before adoption.
Independent dimensions
Mainstream potential
2/10
Technical importance
6/10
Adoption evidence
2/10
- wkhtmltopdf is unmaintained upstream (last meaningful release circa 2015). Security or compatibility issues in the underlying tool cascade to this bundle with no upstream fix path.
- Modern JavaScript (ES6+) rendering is explicitly documented as problematic, limiting applicability to data-heavy or dynamic frontend stacks.
- Maintenance burden acknowledged by KnpLabs: active search for maintainers suggests resource constraints. If maintainer recruitment fails, the bundle could enter true stagnation.
- System binary dependency adds deployment friction compared to pure-PHP alternatives. Container/serverless environments may prohibit or complicate wkhtmltopdf usage.
- No adoption metrics published. Impossible to verify whether bundle is used at scale or only in legacy/small projects, limiting confidence in long-term stability.
Project will likely remain stable but slowly declining in relevance. Pure-PHP and headless browser alternatives continue maturing, reducing reliance on wkhtmltopdf. Bundle may persist as a maintenance-only tool for legacy Symfony codebases that already use it, but new projects are increasingly choosing dompdf (pure PHP), headless Chrome (Puppeteer), or cloud PDF services.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Website
- http://knplabs.com
- Language
- PHP
- License
- MIT
- Last updated
- 6mo ago
- Created
- 195mo ago
- Analyzed with
- anthropic/claude-haiku-4-5
Stars over time
Contributors over time
Top 100 contributors only — repos with more will plateau at 100.
Open issues
Open pull requests
No open pull requests.
Top contributors
Similar repos
barryvdh/laravel-snappy
Laravel Snappy is a Laravel ServiceProvider wrapper for the Snappy library,...
KnpLabs/KnpMenuBundle
KnpMenuBundle integrates the KnpMenu PHP library with Symfony, providing an...
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
1.2k | — | PHP | 7/10 | 6mo ago |
|
|
4.5k | — | PHP | 7/10 | 1mo ago |
|
|
2.8k | — | PHP | 7/10 | 4mo ago |
|
|
1.4k | — | PHP | 7/10 | 5mo ago |
|
|
1.6k | — | PHP | 7/10 | 5mo ago |
|
|
3.4k | — | PHP | 8/10 | 3d ago |
Pure PHP rendering engine (11,143 stars). Does not require system binaries. Likely slower on complex layouts but offers simpler deployment. No external dependency risk.
Another pure-PHP alternative. Similar tradeoffs to dompdf: simpler deployment, slower rendering, no webkit engine complexity.
Modern alternative using headless browsers. Better ES6 support than wkhtmltopdf, more reliable CSS/JS rendering. Requires Node.js runtime; higher resource consumption.
Lightweight pure-PHP library. Lower memory overhead than dompdf but less HTML/CSS feature parity. Suitable for simpler documents.
The underlying library without Symfony integration. Direct use requires manual configuration and service registration. Bundle saves boilerplate for Symfony projects.
