knplabs/snappy

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

View on GitHub ↗Jump to charts ↓Open shareable report

Summary Information

Updated 43 minutes ago
Added to GitGenius on September 15th, 2026
Created on June 16th, 2010
Open Issues & Pull Requests: 18 (+0)
GitHub issues: Enabled
Number of forks: 438
Total Stargazers: 4,475 (+0)
Total Subscribers: 127 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 1.8 hours
Mean response time: 20.7 days
90th percentile: 87.1 days
Tracked items: 18

Most active contributors

Sign in to see contributor activity.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 4
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 656 days
Stale 30+ days: 3
Stale 90+ days: 3

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 1
Events in 7 days: 1

Top labels

No label distribution available yet.

Most active issues this week

Detailed Description

Snappy is a PHP library that generates thumbnails, snapshots, and PDFs from URLs or HTML pages by wrapping the wkhtmltopdf and wkhtmltoimage command-line tools.

The library solves the problem of converting web content to images and PDFs within PHP applications. It works by providing a thin wrapper around the webkit-based wkhtmltopdf and wkhtmltoimage binaries, which must be installed separately on the host system. Users can pass HTML content or URLs to Snappy and receive generated files, with support for customizing output through options passed to the underlying tools. The library can merge multiple URLs into a single PDF and supports various output modes including direct browser display, file downloads, and local file generation.

Snappy suits projects that need reliable HTML-to-PDF or HTML-to-image conversion within a PHP application. It works across OSX, Linux, and Windows. The README notes that wkhtmltopdf version 0.12.x is required, and it includes a security warning about the `--enable-local-file-access` option, which can expose local files or lead to remote code execution if used with untrusted HTML or JavaScript. The documentation recommends sanitizing user input, running wkhtmltopdf in a sandbox using AppArmor or SELinux, and considering alternatives like WeasyPrint, Prince, or Puppeteer for untrusted content. Framework integrations exist for Symfony, Laravel, and Zend Framework.

The project maintains continuous integration across multiple platforms and actively documents known issues in its FAQ, directing users there before opening new issues since many problems stem from the underlying wkhtmltopdf tool rather than Snappy itself. The maintainers are actively seeking additional contributors to help with ongoing maintenance.