To save an existing webpage as a PDF from Laravel, use Spatie Browsershot’s Browsershot::url($url)->savePdf($path). If Laravel has already rendered the page’s HTML, use Browsershot::html($html)->savePdf($path) instead. Both methods rely on a Node.js and Chrome or Chromium runtime where the PDF job runs, so install and configure those dependencies on the web server, container, or queue worker that performs the render.
Choose the right Laravel PDF workflow
Use Browsershot directly for an existing URL
When the page already exists at a URL that your application can reach, pass that URL to Browsershot. This is the shortest path from webpage to PDF and avoids first copying the page into a Blade view.
Use HTML input for markup generated by Laravel
If Laravel has already built the markup—for example, from a Blade view—pass that HTML to Browsershot. This avoids a second HTTP request to retrieve a page your application has already rendered. Browsershot also documents loading HTML from a local file. See the Browsershot PDF documentation.
Use Laravel PDF when you want its facade and driver configuration
Spatie’s separate Laravel PDF package provides a Laravel-oriented PDF facade and supports multiple drivers. Its documented default is Browsershot, and withBrowsershot() lets you customize the Browsershot instance for an individual document after the configured defaults have been applied. Do not confuse this facade with the standalone Browsershot API. See the Laravel PDF documentation.
#1 Best Overall
- PORTABLE SCANNER FOR USE ON-THE-GO — The fastest and lightest mobile single-sheet-fed compact document scanner in its class¹
- QUICK DOCUMENT SCANNING ― This Epson ultra-fast scanner scans a single page as quickly as 5.5 seconds²; Windows and Mac compatible
- VERSATILE PAPER HANDLING ― Portable scanner scans documents up to 8.5 x 72 in; Also easily digitizes receipts and ID cards to make accounting, bookkeeping, and organizing simpler
- INTUITIVE, HIGH-SPEED SOFTWARE — Epson ScanSmart Software³ is a smart tool allowing you to easily scan, review, and save; Stay organized easily with the help of this Epson scanner
- EASY SETUP — USB-powered connect to your computer for quick and simple scanning; No batteries or external power supply required to operate portable document scanner; Standard Connectivity: USB 2.0
Install and prepare the rendering runtime
Browsershot does not render a PDF using PHP alone. The Laravel PDF Browsershot driver uses Browsershot and requires Node.js plus a Chrome or Chromium binary at runtime. Install them in the environment that actually runs the PDF code—not just on a developer workstation. For queued rendering, that means the queue worker’s host or container as well.
- Choose your package path. Install Spatie Browsershot for direct calls, or use Spatie Laravel PDF if you want its facade and driver system. Laravel PDF v2 documents PHP 8.2+ and Laravel 11+ requirements; confirm compatibility against the version you intend to install and your project’s locked dependencies. Check Laravel PDF v2 requirements.
- Install Node.js and Chrome or Chromium in the web or worker runtime where rendering will happen.
- Check command visibility. Run PDF generation through the same PHP process or worker context used in production. If it cannot locate Node, npm, Chrome, or Chromium on its
PATH, configure explicit paths. - Publish Laravel PDF configuration if needed. Its configuration can be published with
php artisan vendor:publish --tag=pdf-config. The configuration exposes settings for Node, npm, Chrome, Node modules, binary and temporary directories, andno_sandbox. Set only the paths and options appropriate to your deployment. Review the package runtime requirements and configuration guidance.
Generate a PDF from a webpage URL
Use Browsershot::url() for a webpage you intend Chrome to visit. Replace the URL and output path with values appropriate for your application:
<?php
use SpatieBrowsershotBrowsershot;
$url = 'https://example.com/report';
$path = storage_path('app/reports/report.pdf');
Browsershot::url($url)->savePdf($path);
The directory for the output file must be writable by the PHP process. Browsershot documents both savePdf($path) and saving PDF output by calling save() with a .pdf filename. See the PDF output methods.
Generate a PDF from Laravel-produced HTML
When you already have trusted HTML, provide it directly rather than asking the browser to retrieve a URL:
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- FAST SPEEDS - Scans color and black and white documents a blazing speed up to 16ppm (1). Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- ULTRA COMPACT – At less than 1 foot in length and only about 1. 5lbs in weight you can fit this device virtually anywhere (a bag, a purse, even a pocket).
- READY WHENEVER YOU ARE – The DS-640 mobile scanner is powered via an included micro USB 3. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan.
- WORKS YOUR WAY – Use the Brother free iPrint&Scan desktop app for scanning to multiple “Scan-to” destinations like PC, Network, cloud services, Email and OCR. (2) Supports Windows, Mac and Linux and TWAIN/WIA for PC/ICA for Mac/SANE drivers. (3)
- OPTIMIZE IMAGES AND TEXT – Automatic color detection/adjustment, image rotation (PC only), bleed through prevention/background removal, text enhancement, color drop to enhance scans. Software suite includes document management and OCR software. (4)
<?php
use SpatieBrowsershotBrowsershot;
$html = view('reports.monthly', ['report' => $report])->render();
$path = storage_path('app/reports/monthly.pdf');
Browsershot::html($html)->savePdf($path);
For a workflow that needs the PDF bytes without first saving a local file, Browsershot also documents base64pdf(). If the input is an HTML file, use its documented local-file approach. Consult the Browsershot PDF guide for the API details supported by your installed version.
Render a Blade view with the Laravel PDF facade
With Spatie Laravel PDF, return a PDF response from a controller using the package’s facade. The precise imports and available methods should match the Laravel PDF version installed in your application; this example shows the documented view-to-PDF pattern:
<?php
use SpatieLaravelPdfFacadesPdf;
return Pdf::view('reports.monthly', ['report' => $report])
->name('monthly-report.pdf');
Laravel PDF uses a driver setting, with Browsershot documented as its default. To customize Browsershot for just this document, use withBrowsershot():
return Pdf::view('reports.monthly', ['report' => $report])
->withBrowsershot(function ($browsershot) {
// Apply Browsershot options for this document.
})
->name('monthly-report.pdf');
The closure is applied after configuration defaults, so it is a suitable place for document-specific settings. Use the Laravel PDF documentation for the package’s driver configuration and current API. Laravel PDF introduction · Requirements and configuration.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #3
- STAY ORGANIZED – Easily convert your paper documents into digital formats like searchable PDF files, JPEGs, and more.Power Consumption : 2.5W or less (Energy Saving Mode: 0.7W). Suggested Daily Volume : 500 scans..Does it contain liquid: no
- CONVENIENT AND PORTABLE –lightweight and small in size, you can take the scanner anywhere from home offices, classrooms, remote offices, and anywhere in between
- HANDLES VARIOUS MEDIA TYPES – Digitize receipts, business cards, plastic or embossed cards, reports, legal documents, and more
- FAST AND EFFICIENT – No technical hurdles or complicated setups here; easily scan both sides of a document at the same time, in color or black-and-white, at up to 12 pages-per-minute, and with a 20 sheet automatic feeder
- BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer
Set page size, margins, headers, and other PDF options
Browsershot documents controls for paper format, custom dimensions, margins, headers and footers, backgrounds, transparent backgrounds, tagged output, landscape orientation, scale, and selected page ranges. Pick the options based on the document’s layout rather than relying on a screenshot-like default. The documented scale range is 0.1 to 2; check the API for the exact method names and accepted values for the Browsershot version in your lockfile. Browsershot PDF options.
- Paper format or dimensions: use a predefined format such as A4 or Letter, or set custom paper dimensions for a purpose-specific document.
- Margins: allow room for printed content and any repeating header or footer.
- Headers and footers: use them for repeated document details such as page numbers or a title; inspect the resulting output for clipping and spacing.
- Backgrounds: enable background rendering when the page’s colors or background graphics are part of the intended document. Use transparent background only where a transparent result is appropriate.
- Orientation and scale: choose landscape for wide layouts, and adjust scale within the documented range if content needs to fit.
- Page ranges and tagged output: select specific pages when only part of a document is needed, or enable tagged output when required by your PDF workflow.
External assets and fonts can affect the rendered result. Inspect the PDF produced in the actual deployment environment, especially when the page depends on remote images, stylesheets, or font files.
Validate inputs and protect the renderer
Browsershot’s documentation warns: “It is the responsibility of the user to validate the URLs and HTML passed to browsershot. Only pass URLs and HTML that you trust.” Treat rendering as a security boundary. Do not pass arbitrary user-controlled URLs or markup to a browser process with access to your application’s network or local environment. Read the Browsershot security note.
Troubleshoot common PDF failures
The process cannot find Node, npm, or Chrome
Cause: the PHP process, queue worker, or container has a different environment or PATH from your interactive shell. Fix: install dependencies in the rendering environment and configure explicit Node, npm, Chrome/Chromium, binary, or module paths in Laravel PDF’s published configuration where necessary.
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Rank #4
- IRIScan Express, portable scanner : scans color and black and white documents a blazing speed up to 8ppm simplex. Color scanning won’t slow you down as the color scan speed is the same as the black and white scan speed.
- IRIScan Express mobile scanner is powered via an included micro USB 2. 0 cable allowing you to use it even where there is no outlet available. Plug it into you PC or laptop and you are ready to scan. USB cable provided. AC Adapter not provided and not needed.
- IRIScan flatbed scanner uses a simplex scanning mode allows for quick and straightforward scanning of single-sided documents. IRIScan with its full portable features is the ideal document scanners for computers.
- IRIScan document scanner : Versatile scanning capabilities, including scanning to Word, PDF, and Excel formats with companion software provided Readiris OCR
- Receipt scanner and card scanner with Additional features include scanning business cards directly to Outlook, photo scanning, and receipt scanning for efficient document management
The PDF is not written
Cause: the output directory may not exist or may not be writable by the process generating the PDF. Fix: use an application storage path, ensure the directory exists, and grant the runtime user write access. Confirm the application is passing a PDF path to savePdf().
The PDF is blank or missing page content
Cause: the target page may not have loaded the expected content, or assets such as fonts and images may not be available to the browser at render time. Fix: check that the rendering environment can reach the URL and required assets, and inspect the actual output there. For content already rendered by Laravel, consider passing the generated HTML directly instead of requesting a URL.
Rendering works locally but fails in a worker or container
Cause: runtime packages, binary paths, temporary directories, permissions, or sandbox settings differ in the worker environment. Fix: verify the installed dependencies and configured paths in that exact environment, and review Laravel PDF’s settings, including no_sandbox, for the deployment context. Do not change sandboxing settings without understanding the security implications.
Layout differs from the intended print document
Cause: the page format, margins, orientation, scale, backgrounds, or external assets may not suit the document. Fix: set the relevant PDF options explicitly and inspect the rendered file. Check the Browsershot API for the methods available in the version installed.
Best Value
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
Or skip the browser setup
If you need to capture a webpage as a PDF without installing and maintaining the browser-rendering stack in your Laravel environment, ScreenshotNeo provides a screenshot API and MCP server. A request can return a PDF; this is a separate service, not the Browsershot PDF facade.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com/report -o report.pdf
See the ScreenshotNeo API documentation for request details. ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before the shot; bot checks, blank pages, failed loads, timeouts, and cache hits are not billed. Its MCP server lets AI agents use screenshot tools, and the free plan includes 1,000 screenshots a month without a card; paid plans start at $5 for 3,000 shots. Learn about ScreenshotNeo or sign up for 1,000 free screenshots a month with no card.
Frequently Asked Questions
Can Browsershot return PDF data without saving a file first?
Yes. Browsershot documents base64pdf() for workflows that need PDF data without first writing a local file.
Can I use the Laravel PDF facade and standalone Browsershot in the same project?
They are distinct APIs. Laravel PDF is an integration package with a facade and driver configuration; Browsershot can also be called directly. Choose the approach that fits how your application builds and returns documents.
Which Laravel PDF driver should I use if Chrome cannot be installed locally?
Laravel PDF documents Browsershot, Chrome, Cloudflare, DOMPDF, Gotenberg, and WeasyPrint drivers. Choose according to rendering requirements and whether a local browser, remote service, or separate rendering service fits your deployment; the documentation does not establish a universal fidelity or speed ranking.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

