# KnpLabs/snappy

PHP library allowing thumbnail, snapshot or PDF generation from a url or a html page. Wrapper for wkhtmltopdf/wkhtmltoimage

Repository: https://github.com/KnpLabs/snappy
Canonical: https://ross.abutalabs.com/products/knplabs-snappy
Homepage: https://knplabs.com
Language: PHP
License: MIT
License Family: permissive
Topics: hacktoberfest, php, image-generation, html-to-pdf, pdf-generation, html-to-image
Last push: 2026-07-29T11:04:03+00:00

## Health v2 (maintenance only)
Score: 92/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 95, release rhythm 83, longevity 100
- inputs: {"age_days": 5922, "days_push": 35, "days_rel": 35, "gap_med": 74, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4476, forks 437 (observed 2026-08-28T04:08:51.076914+00:00)

## What it is
Snappy is a PHP library that wraps the wkhtmltopdf and wkhtmltoimage binaries to generate PDFs, snapshots, or thumbnails from URLs or HTML pages. It provides a simple object-oriented API and has framework integrations for Symfony, Laravel, and Zend Framework.

## Use cases
- generate a pdf from a url in php
- convert html page to pdf
- create thumbnails or screenshots of web pages
- merge multiple urls into a single pdf
- render invoices as pdf from html templates
- snapshot a webpage as an image

## When to choose
- you need server-side PDF or image generation from HTML in a PHP application
- you can install and control the wkhtmltopdf binary on your server
- you want a thin, well-maintained wrapper with framework bundles available

## When to avoid
- you process untrusted HTML or JavaScript, since wkhtmltopdf's local file access can be a security risk
- you need modern CSS support or a pure-PHP solution without external binaries
- you are not using PHP or cannot install system binaries

## Facets
- artifact type: library
- maturity: stable
- function: pdf, image-processing, developer-tools
- domain: pdf, web-development, files
- platform: php, windows, cli
- tags: wkhtmltopdf, html-to-pdf, pdf-generation, html-to-image, thumbnail-generation, wrapper, linux, macos

## Member repositories
- KnpLabs/snappy (main) score 92

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:51.076914+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-29T18:20:34.172553+00:00, confidence not recorded.
  - readme: https://github.com/KnpLabs/snappy (fetched 2026-08-28T04:08:51.076914+00:00, sha 40f6508af6c2)
  - homepage: https://knplabs.com (fetched 2026-08-29T09:06:57.520587+00:00, sha 3e099e7188ae)
- Data as of 2026-08-30T08:39:29.467469+00:00.
