DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
Skip to content
World desk6 min

How to Generate a Webpage PDF in Laravel with Browsershot

Use Browsershot to render an existing URL or trusted Laravel-generated HTML as a PDF, then configure the browser runtime and page layout for your deployment.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

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 HTML you want to print, pass that markup to Browsershot::html($html)->savePdf($path). The rendering job needs Node.js and Chrome or Chromium available where it runs.

Install and prepare the rendering runtime

Browsershot runs a browser to render a page and produce the PDF. Install the package required by your chosen integration and make sure Node.js and a Chrome or Chromium binary are installed in the environment that actually runs the job: that may be a web server, queue worker, or container. Laravel PDF’s documentation lists these requirements for its Browsershot driver; check the requirements for the versions pinned in your application before deployment. Laravel PDF v2 requirements specify PHP 8.2+ and Laravel 11+.

As an Amazon Associate I earn from qualifying purchases.

If you use the Laravel PDF package, it documents Browsershot as its default driver. This facade is part of Laravel PDF, not the standalone Browsershot API. For direct Browsershot examples, see Spatie Browsershot’s PDF guide.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Save a webpage URL as a PDF

Use URL input when you want Chrome to load an existing webpage. Replace the URL and destination with values appropriate for your application:

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner | For Computers including PC and Mac Receipt and Document Scanner USB Powered
  • 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
use SpatieBrowsershotBrowsershot;

$url = 'https://example.com';
$path = storage_path('app/example.pdf');

Browsershot::url($url)->savePdf($path);

The destination is a local path on the machine running the PHP process. Browsershot also documents saving PDF output with save() when the destination filename ends in .pdf; savePdf() makes the intended output type explicit.

Render HTML produced by Laravel

When you already have trusted HTML—for example, markup rendered for a report—use html() instead of asking the browser to load a URL:

use SpatieBrowsershotBrowsershot;

$html = '<!doctype html><html><body><h1>Monthly report</h1></body></html>';
$path = storage_path('app/monthly-report.pdf');

Browsershot::html($html)->savePdf($path);

Browsershot also documents loading HTML from a local file path. If a workflow needs the PDF data rather than an immediately saved file, its base64pdf() method returns a base64 representation. See the PDF API documentation for the method details.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Brother DS-640 Compact Mobile Document Scanner, (Model: DS640)
  • 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)

Use Laravel PDF with a Blade view

Laravel PDF provides a PDF facade and driver configuration, including a documented Browsershot driver. Choose this integration when you want to generate a PDF from a Laravel view through that package rather than call Browsershot directly. Follow the package’s installation instructions for your locked version, then select or configure the driver and render the document using its facade API.

For settings that apply to one document, withBrowsershot() accepts a closure to customize the Browsershot instance after configuration defaults are applied. The package documents its driver and configuration options at Laravel PDF installation and setup.

Configure binary paths for servers and workers

If PHP cannot find Node, npm, Chrome, or Chromium through its environment’s PATH, configure explicit paths. This commonly matters when the command-line shell works but PHP-FPM, a queue worker, or a container runs with a different environment.

Rank #3
Sale
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
  • 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
  1. Publish Laravel PDF’s configuration with php artisan vendor:publish --tag=pdf-config, if you are using Laravel PDF.
  2. In the published configuration, set the Node, npm, Chrome, Node modules, binary, and temporary-directory settings to paths that exist in the runtime that executes PDF jobs.
  3. Review the documented no_sandbox setting against your deployment’s security requirements; do not enable it as a generic fix without understanding the environment.
  4. Run a PDF job through the same execution path used in production, including the queue worker if applicable, and inspect the resulting file.

Configuration keys and version requirements can change, so use the configuration documentation corresponding to the version in your dependency lock file: Laravel PDF configuration.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Set page size, margins, and print layout

Browsershot documents PDF controls for page format, custom dimensions, margins, headers and footers, background rendering, transparent backgrounds, tagged output, landscape orientation, scale, and selected page ranges. Choose options to suit the document rather than relying on a default that may not match the intended paper or print layout.

Need What to configure
Standard paper Choose a predefined format such as A4 or Letter.
Nonstandard paper Set custom paper dimensions.
More or less printable space Set page margins.
Running page information Configure headers or footers.
Colored or image backgrounds Enable background rendering; use a transparent background only when that is the intended output.
Wide layouts Use landscape orientation when appropriate.
Fit or scale content Set scale; the documented range is 0.1 to 2.
Only part of a long document Select the page range to include.
Accessible PDF output Use the documented tagged-output option when required by your workflow.

For exact method names and accepted values, consult Browsershot’s PDF options. Inspect the generated PDF in the deployment environment, particularly when the page relies on external assets or fonts.

Rank #4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
  • 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

Validate inputs and protect the rendering job

A PDF renderer that loads a URL or processes HTML should not be treated as a safe way to accept arbitrary user input. The Browsershot documentation states: “It is the responsibility of the user to validate the URLs and HTML passed to browsershot. Only pass URLs and HTML that you trust.” Validate and constrain destinations and markup before rendering, especially when requests can be influenced by users. Browsershot security note.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshoot common failures

  • Node or browser executable not found: Install the required runtime in the job environment and configure explicit paths if PHP’s process cannot see them.
  • Works locally but fails in a queue: Check the queue worker’s installed binaries, environment variables, permissions, and Laravel PDF configuration; the worker may not share the web shell’s PATH.
  • PDF is missing images, fonts, or other styling: Check that the rendered page can access those assets from the server or browser runtime. Inspect the output produced in the deployment environment.
  • Layout or pagination is wrong: Revisit paper format, margins, orientation, scale, and page ranges. Check the source page’s print styling and whether backgrounds need to be rendered.
  • Unsafe or unexpected page loads: Do not pass unchecked URLs or HTML. Restrict input to trusted destinations and content before invoking Browsershot.

Or skip the browser setup

If your goal is a screenshot rather than a PDF, ScreenshotNeo provides a website screenshot API and MCP server. Its one-call API returns an image; it is not a replacement for this PDF workflow.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. Cookie and consent banners, newsletter popups, and chat widgets are removed before the shot; each step can be turned off. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits cost nothing, with response headers indicating the page verdict and billing status. Its MCP server includes tools for AI agents to take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

FAQ

Can Browsershot return PDF data without saving a file first?

Yes. Browsershot documents base64pdf() for workflows that need PDF data in base64 form.

Best Value
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
  • Scanner type: Document
  • Connectivity technology: USB
  • With Auto Scan Mode, the scanner automatically detects what you're scanning
  • Digitize documents and images

Is Laravel PDF the same package as Browsershot?

No. Browsershot is the rendering package; Laravel PDF is a separate Laravel integration with driver configuration and a PDF facade.

Which rendering driver should I use?

Laravel PDF documents Browsershot, Chrome, Cloudflare, DOMPDF, Gotenberg, and WeasyPrint drivers. Choose based on your CSS and layout needs, runtime constraints, and whether a remote or separate rendering service suits your deployment. The documentation cited here does not establish a universal performance or fidelity winner.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

SaleBestseller No. 3
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
Canon imageFORMULA R10 - Portable Document Scanner, USB Powered, Duplex Scanning, Document Feeder, Easy Setup, Convenient, Perfect for Mobile Users, White
BROAD COMPATIBILITY – Works with both Windows and Mac devices, be it laptop or computer; This product is not intended for scanning photographs on photo paper / photographic media
$153.00
Bestseller No. 4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
Find our Software here : irislink.com/start; IRIScan Express is only compatible Windows platform and not macintosh
$129.00
Bestseller No. 5
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Canon Canoscan Lide 300 Scanner (PDF, AUTOSCAN, Copy, Send)
Scanner type: Document; Connectivity technology: USB; With Auto Scan Mode, the scanner automatically detects what you're scanning
$75.00

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.