A PHP package that converts HTML to images, PDFs, or text using Puppeteer and headless Chrome.
Browsershot is a PHP package that converts HTML content—from URLs, strings, or local files—into images (PNG/JPEG) or PDFs. It solves the need for programmatically capturing web pages or generating documents with accurate rendering, including JavaScript-executed content, directly from PHP applications.
PHP developers, especially those using Laravel or similar frameworks, who need to generate images or PDFs from web content for reports, snapshots, or document automation.
Developers choose Browsershot for its seamless PHP integration, fluent API, and reliance on Puppeteer for consistent, modern browser rendering without managing browser instances manually, making it a robust alternative to CLI-based tools.
Convert HTML to an image, PDF or string
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers an intuitive, chainable interface for conversions, abstracting the complexity of Puppeteer setup and execution, as shown in the simple Browsershot::url()->save() examples.
Executes JavaScript before capturing, enabling accurate snapshots of dynamic content like SPAs, demonstrated by the bodyHtml() method for post-JavaScript HTML extraction.
Supports URLs, HTML strings, and local files via methods like html() and htmlFromFilePath(), providing versatility for different content origins.
Leverages Puppeteer and headless Chrome for up-to-date web standards compliance, including optional newHeadless() mode for improved rendering.
Includes triggeredRequests() to monitor network activity during rendering, aiding in troubleshooting complex page interactions.
Requires a separate Node environment and Puppeteer installation, adding complexity to PHP-only projects and potentially increasing deployment overhead.
Running headless Chrome can consume significant memory and CPU, making it less suitable for high-volume or real-time conversion scenarios without careful scaling.
Initial configuration involves managing Chrome and Puppeteer dependencies, which can be error-prone, especially in constrained or containerized environments.