KnpLabs

KnpLabs/KnpSnappyBundle

PHP MIT Web Dev

Easily create PDF and images in Symfony by converting html using webkit

1.2k stars
142 forks
slow
GitHub

1.2k

Stars

142

Forks

1

Open issues

30

Contributors

v1.10.6 07 Jan 2026

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.

Web Dev Library Discovery value: 4/10
Documentation 8/10
Activity 6/10
Community 7/10
Code quality 5/10

Inferred from signals mentioned in the README (tests, CI, type safety) — not a review of the actual code.

Overall score 7/10

AI's overall editorial judgment — not an average of the bars above, can weigh other factors too.

pdf-generation html-to-pdf symfony-bundle document-conversion wkhtmltopdf
MIT licensed Niche/specialized use case Actively maintained Beginner friendly Production ready
Deep Analysis · Based on README and public signals
1w ago

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.

Origin

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

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.

In production

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.

Code analysis
Architecture

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.

Tests

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.

Maintenance

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.

Honest verdict

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

Risks
  • 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.
Prediction

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.

0 found this helpful

Newsletter

Get analyses like this every Monday

Free weekly digest of the most interesting open-source discoveries.

Languages

PHP
100%

Information

Language
PHP
License
MIT
Last updated
6mo ago
Created
195mo ago
Analyzed with
anthropic/claude-haiku-4-5

Stars over time

Loading…

Contributors over time

Top 100 contributors only — repos with more will plateau at 100.

Loading…

Open pull requests

No open pull requests.

Similar repos

KnpLabs

KnpLabs/snappy

Snappy is a PHP wrapper library for wkhtmltopdf and wkhtmltoimage that enables...

4.5k PHP Dev Tools
barryvdh

barryvdh/laravel-snappy

Laravel Snappy is a Laravel ServiceProvider wrapper for the Snappy library,...

2.8k PHP Web Dev
KnpLabs

KnpLabs/KnpMenuBundle

KnpMenuBundle integrates the KnpMenu PHP library with Symfony, providing an...

1.4k PHP Web Dev
mikehaertl

mikehaertl/phpwkhtmltopdf

PHP WkHtmlToPdf is a lightweight OOP wrapper around the wkhtmltopdf...

1.6k PHP Dev Tools
symfony

symfony/maker-bundle

Symfony MakerBundle is a code generator for Symfony applications that rapidly...

3.4k PHP Dev Tools
vs. alternatives
dompdf

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.

mPDF

Another pure-PHP alternative. Similar tradeoffs to dompdf: simpler deployment, slower rendering, no webkit engine complexity.

Puppeteer/Playwright (headless Chrome)

Modern alternative using headless browsers. Better ES6 support than wkhtmltopdf, more reliable CSS/JS rendering. Requires Node.js runtime; higher resource consumption.

TCPDF

Lightweight pure-PHP library. Lower memory overhead than dompdf but less HTML/CSS feature parity. Suitable for simpler documents.

KnpLabs/Snappy (parent)

The underlying library without Symfony integration. Direct use requires manual configuration and service registration. Bundle saves boilerplate for Symfony projects.