# KnpLabs/KnpSnappyBundle

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

Repository: https://github.com/KnpLabs/KnpSnappyBundle
Canonical: https://ross.abutalabs.com/products/knpsnappybundle
Homepage: http://knplabs.com
Language: PHP
License: MIT
License Family: permissive
Topics: php, symfony-bundle, symfony, pdf-generation, image-generation, html-to-pdf, html-to-image, hacktoberfest
Last push: 2026-01-07T10:30:46+00:00

## Health v2 (maintenance only)
Score: 70/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 61, release rhythm 65, longevity 100
- inputs: {"age_days": 5911, "days_push": 238, "days_rel": 238, "gap_med": 18, "n_releases_24m": 4}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1247, forks 140 (observed 2026-08-28T04:04:07.631929+00:00)

## What it is
A Symfony bundle integrating the Snappy PHP wrapper around wkhtmltopdf/wkhtmltoimage, letting Symfony apps convert HTML documents or URLs into PDF files and images via the WebKit engine. It registers configurable services for PDF and image generation.

## Use cases
- generate pdf invoices from html templates in symfony
- convert html page to pdf for download
- render a url to an image screenshot
- create pdf reports from twig views
- export html to image in php

## When to choose
- you have a Symfony app and need server-side HTML-to-PDF or HTML-to-image conversion
- your HTML is simple and doesn't rely on modern ES6 JavaScript
- you want a maintained wrapper around wkhtmltopdf with Symfony service integration

## When to avoid
- your pages depend heavily on modern JavaScript/ES6 rendering, since wkhtmltopdf lacks full ES6 support
- you need pixel-perfect rendering of complex modern CSS
- you're not using Symfony and only need the underlying Snappy library

## Facets
- artifact type: plugin
- maturity: active
- function: pdf, image-processing, templating
- domain: web-development, pdf, files
- platform: php, self-hosted
- tags: symfony-bundle, wkhtmltopdf, html-to-pdf, html-to-image, pdf-generation, web-server

## Member repositories
- KnpLabs/KnpSnappyBundle (main) score 70

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:07.631929+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T05:07:55.619206+00:00, confidence not recorded.
  - readme: https://github.com/KnpLabs/KnpSnappyBundle (fetched 2026-08-28T04:04:07.631929+00:00, sha e525918b71a8)
  - homepage: http://knplabs.com (fetched 2026-08-29T12:19:01.711065+00:00, sha 3e099e7188ae)
- Data as of 2026-08-30T08:39:29.467469+00:00.
