Convert HTML to an image, PDF or string
5.2k
Stars
508
Forks
0
Open issues
30
Contributors
AI Analysis
Browsershot is a PHP library that converts HTML, URLs, and local files into images or PDFs using Puppeteer and headless Chrome. It's specifically designed for developers building PHP applications who need server-side screenshot or PDF generation capabilities, and is not a general-purpose tool—it's tightly integrated into PHP ecosystems and requires Puppeteer infrastructure. Best suited for Laravel applications, content management systems, and reporting tools that need programmatic rendering.
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.
PHP wrapper around Puppeteer for HTML-to-PDF and screenshot generation
Browsershot is a PHP library from Spatie that converts HTML, URLs, or local files into images or PDFs by orchestrating a headless Chrome browser via Puppeteer under the hood. It is built primarily for Laravel and PHP developers who need server-side webpage rendering without managing raw browser automation. With 5,235 stars, 508 forks, over 10 years of history, and active maintenance as of July 2026, it occupies a well-established niche in the PHP ecosystem. The dependency on both Node.js and Puppeteer adds infrastructure complexity that may deter some users, but the trade-off is accurate, JavaScript-aware rendering.
Created in May 2014 by Freek Van der Herten at Spatie, it initially used PhantomJS (v1), then switched to headless Chrome CLI (v2), and later adopted Puppeteer for its current v3/v4 architecture. This evolution tracks the broader shift in headless browser tooling across the industry.
Growth was primarily driven by Spatie's strong reputation in the Laravel community and organic demand for PDF/screenshot generation in web apps. The project grew steadily over a decade rather than through a viral moment. Recent star velocity (0 in 7 days) suggests the project has plateaued in awareness — it likely already saturates its target audience — rather than declining in use.
Packagist download badge is displayed prominently; total downloads are not quoted in the README excerpt, but the package has been available for over 10 years with consistent maintenance. The 508 forks and sustained star count are consistent with production usage. Adoption is plausible and likely substantial within the PHP/Laravel ecosystem, but specific production deployment numbers are not verified from available data.
Appears to be a PHP class-based wrapper that shells out to a Node.js/Puppeteer script. Likely uses process spawning or similar IPC to communicate between PHP and the headless Chrome instance. The API is fluent/method-chaining style based on README examples. Requires both PHP (Composer) and Node.js (npm) environments to be available on the same host.
A test suite exists and is referenced in the README with a CI badge from GitHub Actions. Tests require Puppeteer and pdftotext (poppler-utils) to be installed, suggesting integration-level tests rather than pure unit tests. Exact coverage percentage not documented in README.
Last push was July 9, 2026 — the same day as this analysis — indicating active maintenance. CI is configured and passing according to the badge. Spatie as an organization has a strong track record of long-term package support. No signs of neglect.
ADOPT IF: you are in a PHP/Laravel environment and need reliable rendering of JavaScript-heavy pages to PDF or images, and you can install Node.js and Puppeteer on your server or container. AVOID IF: your deployment environment prohibits Node.js installation, you need a fully PHP-native solution, or you are operating at very high throughput where per-request Chrome spin-up costs are prohibitive. MONITOR IF: you are evaluating Gotenberg or similar API-based alternatives as a way to decouple browser rendering from your PHP process — the architecture decision may matter more than the library itself.
Independent dimensions
Mainstream potential
3/10
Technical importance
6/10
Adoption evidence
6/10
- Hard dependency on both Node.js and Puppeteer means two separate runtime stacks must be installed, versioned, and secured on the host — complicating deployment in shared hosting, restrictive containers, or locked-down environments.
- Headless Chrome is resource-intensive; running many concurrent Browsershot jobs can exhaust server memory and CPU, requiring careful queueing and concurrency management that the library itself does not provide.
- Puppeteer and Chrome update independently; breaking changes in Puppeteer's API have historically required Browsershot updates, creating occasional compatibility lag between Chrome versions and the PHP wrapper.
- The PHP-to-Node process-spawning bridge introduces latency and potential failure modes (e.g., zombie processes, environment variable leakage) that are harder to debug than pure-PHP solutions.
- Zero star growth in the observed 7-day window may indicate the project has reached saturation within its niche, meaning community momentum for new feature contributions may be limited going forward.
Likely to remain a stable, well-maintained utility within the Spatie portfolio and the Laravel ecosystem for the foreseeable future. Unlikely to expand significantly beyond PHP developers. Containerized alternatives may gradually erode its install-base on cloud-native deployments.
Newsletter
Get analyses like this every Monday
Free weekly digest of the most interesting open-source discoveries.
Languages
Information
- Language
- PHP
- License
- MIT
- Last updated
- 1d ago
- Created
- 148mo 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
No open issues — clean slate.
Open pull requests
No open pull requests.
Top contributors
Recent releases
Similar repos
| Repository | Stars | Week Δ | Language | Score | Updated |
|---|---|---|---|---|---|
|
|
5.2k | — | PHP | 8/10 | 1d ago |
|
|
4.5k | — | PHP | 7/10 | 1mo ago |
|
|
1.4k | — | PHP | 8/10 | 2w ago |
|
|
1k | — | PHP | 8/10 | 2w ago |
|
|
2.7k | — | PHP | 8/10 | 4d ago |
|
|
1.2k | — | PHP | 7/10 | 6mo ago |
wkhtmltopdf uses an older WebKit engine without JavaScript execution support. Browsershot's Puppeteer backend handles modern JS-heavy pages far better, but wkhtmltopdf has no Node.js dependency and is simpler to deploy on minimal servers.
These are PHP-native PDF generators that construct PDFs from PHP code or HTML fragments. They don't render via a real browser, making complex CSS/JS layouts unreliable. Browsershot produces pixel-accurate output but at higher infrastructure cost.
Puppeteer itself is the underlying engine. Using it directly in Node.js gives more control and avoids the PHP-to-Node bridge overhead, but Browsershot is the right choice when the rest of the stack is PHP and developers want to avoid switching contexts.
Playwright is a more modern multi-browser automation framework with better cross-browser support. It lacks a mature PHP wrapper with Browsershot's API ergonomics, so PHP developers would need custom integration work.
Gotenberg is a Docker-based API for PDF generation supporting multiple backends. It removes the Node.js-on-host requirement and is more suitable for containerized microservice architectures, but adds network call overhead and a separate service to manage.
