Package

Spatie Browsershot

Convert a webpage to an image or pdf using headless Chrome

Package

spatie/browsershot

View on GitHub →

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 →

Spatie Browsershot Related Articles

Driver-Based Architecture in Spatie's Laravel PDF v2 image

Driver-Based Architecture in Spatie's Laravel PDF v2

Read article
Media Library Pro: Vue, React and Blade components to handle uploads (sponsor) image

Media Library Pro: Vue, React and Blade components to handle uploads (sponsor)

Read article
Spatie Shares Their Coding Guidelines as AI Skills image

Spatie Shares Their Coding Guidelines as AI Skills

Read article
Capture Web Page Screenshots in Laravel with Spatie's Laravel Screenshot image

Capture Web Page Screenshots in Laravel with Spatie's Laravel Screenshot

Read article
Image Optimization With Spatie Laravel Image Optimizer image

Image Optimization With Spatie Laravel Image Optimizer

Read article
New Major Versions of Spatie Image and Laravel Media Library Released image

New Major Versions of Spatie Image and Laravel Media Library Released

Read article

Let your users buy domains without leaving your app

If your Laravel app gives users a site, a storefront, or a workspace, they’ll eventually want their own domain. The name.com API lets them search, register, and connect one without leaving your product. It’s a clean REST API, so Laravel’s HTTP client is all you need.

Let your users buy domains without leaving your app

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum