spatie/browsershot
Convert web pages or raw HTML to images and PDFs in PHP using Puppeteer-driven headless Chrome. Capture screenshots, generate PDFs, fetch rendered body HTML, and inspect triggered network requests—ideal for reports, previews, and testing.
evaluateOnNewDocument). Use cases expand to:
evaluateOnNewDocument).v2 with Chrome CLI or v1 with PhantomJS).dompdf or snappy).Executives: *"This update lets us generate PDFs/images with real-time JavaScript execution—think of it as a ‘save as PDF’ button that can modify the page after it loads. For example:
Engineering:
*"New feature: evaluateOnNewDocument lets you run Puppeteer scripts after the page loads but before capturing the output. Key use cases:
Browsershot syntax:
Browsershot::html($html)
->evaluateOnNewDocument('document.title = "Custom Title"')
->save('output.pdf');
How can I help you explore Laravel packages today?