Package
Spatie Browsershot
Convert a webpage to an image or pdf using headless Chrome
Overview
What Spatie Browsershot does
Browsershot allows developers to convert web pages into images or PDFs using headless Chrome via Puppeteer.
The package addresses the need to capture and convert web page content dynamically and programmatically, ideal for applications requiring automated reporting or content archiving. By leveraging Puppeteer, Browsershot operates with a headless version of Google Chrome to perform these conversions silently and efficiently in the background.
Developers can save a URL's output as an image or PDF by specifying the file path with the corresponding extension. Additionally, the package accepts direct HTML input, enabling conversion without a live URL. This flexibility supports use cases like creating PDFs from dynamically generated HTML content or local HTML files.
Browsershot also extends beyond simple conversions. Developers can retrieve the HTML body of a page after JavaScript execution or gather a list of all requests triggered during a page's loading process. These features provide deeper insights into web page loading and interactions, essential for performance monitoring or debugging.
The use of Chrome's latest headless mode further enhances Browsershot's adaptability, making it suitable for modern web applications that utilize JavaScript extensively. This package seamlessly integrates into a PHP environment, making it a compelling choice for Laravel developers who need reliable webpage rendering solutions.
This overview was generated by AI from the package README and may not reflect the latest release.
Read the full README →