Use Playwright’s page.pdf() to save a web page as a paginated PDF; use page.screenshot() for an image. A full-page screenshot is still an image, not a PDF. Playwright renders PDFs with print CSS by default, so switch to screen media before export if you want the page’s screen layout.
Choose the right Playwright method
| What you need | Use | What it creates |
|---|---|---|
| A printable document | page.pdf() |
A paginated PDF, rendered with print CSS by default |
| A viewport or full-length image | page.screenshot() |
An image such as PNG, JPEG, or WebP; it does not create a PDF |
| A repeatable visual-regression check | Playwright Test’s expect(page).toHaveScreenshot() |
A screenshot assertion against a baseline image, not a PDF export |
The official Page API documents the PDF and screenshot methods separately. The screenshot guide covers saving screenshots to files or buffers.
Save a web page as a PDF
After navigating to the page, call page.pdf(). Pass a file path to save the returned PDF buffer to disk:
await page.goto('https://example.com');
await page.pdf({ path: 'page.pdf', format: 'A4', printBackground: true });
This example requests A4 paper and includes background graphics. If you omit path, the method returns a PDF buffer that your code can handle or store itself.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Repair Windows errors before they cause bigger problems3Scan for outdated or missing drivers - takes under a minute#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
Set paper size, margins, and pages
Use format for a paper preset, or set width and height directly. Supported units include pixels, inches, centimeters, and millimeters; unlabeled width and height values are pixels. Other useful PDF options are:
marginto set page margins.pageRangesto export selected pages.printBackgroundto include background graphics.preferCSSPageSize: trueto give the document’s CSS@pagesize priority overwidth,height, orformat.
For example, a project may use await page.pdf({ path: 'report.pdf', format: 'A4', margin: { top: '12mm', right: '12mm', bottom: '12mm', left: '12mm' }, printBackground: true, pageRanges: '1-3' });. Check the resulting file: page breaks and print styles are controlled by the page as well as by your export options.
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)
Choose print or screen styling in the PDF
PDF export uses print CSS media by default. If the page’s print stylesheet changes the layout or hides elements you want, emulate screen media before calling page.pdf():
await page.goto('https://example.com');
await page.emulateMedia({ media: 'screen' });
await page.pdf({ path: 'page-screen.pdf', printBackground: true });
Screen media changes which CSS media rules apply; it does not turn the PDF into a screenshot. Review the output because the site’s styles can still affect its appearance.
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
Backgrounds and print colors
printBackground: true controls whether background graphics are printed. It is separate from print color adjustment: Playwright documents -webkit-print-color-adjust for forcing exact colors when print rendering modifies them. If brand colors or shaded sections look different, check both this CSS behavior and the page’s print rules.
Capture a full-page screenshot as an image
To capture the entire scrollable page as an image, set fullPage: true:
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
await page.goto('https://example.com');
await page.screenshot({ path: 'full-page.png', fullPage: true });
Without fullPage: true, the screenshot is generally limited to the viewport. Screenshot options also include clipping coordinates, output type, lossy-image quality, and scale. scale: 'css' uses one image pixel per CSS pixel; scale: 'device' uses device pixels and can produce a larger image on high-DPI displays. These settings apply to screenshot output, not PDF pagination.
Run a visual screenshot check consistently
For visual regression testing, Playwright Test’s expect(page).toHaveScreenshot() compares against a baseline image. The assertion waits for consecutive screenshots to match before comparing. It is not a way to export a PDF.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Best Value
- Scanner type: Document
- Connectivity technology: USB
- With Auto Scan Mode, the scanner automatically detects what you're scanning
- Digitize documents and images
Rendering can vary with the host operating system, browser version, settings, hardware, power source, and headless mode. Keep the baseline-generation and comparison environments consistent; otherwise, environment differences can cause screenshot changes unrelated to the page code. See the official visual comparisons guide.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Troubleshoot common output problems
- The PDF is missing screen-only styling: Call
await page.emulateMedia({ media: 'screen' })beforepage.pdf(). - PDF colors or backgrounds look wrong: Set
printBackground: trueif background graphics are missing. For adjusted print colors, inspect the CSS print rules and consider-webkit-print-color-adjust. - The screenshot only shows the visible area: Add
fullPage: truetopage.screenshot(). This makes a longer image, not a PDF. - Visual tests differ between machines: Align the operating system, browser version, settings, hardware, and headless configuration used for the baseline and comparison where possible.
- The PDF’s size or pagination is unexpected: Check the page’s
@pagerules, your paper dimensions, margins, andpreferCSSPageSize; inspect the generated PDF to verify the result.
Or skip the browser setup
If you need a screenshot or PDF from an API rather than running Playwright, ScreenshotNeo returns one from a GET request. For example, save a web page as a PDF:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -d format=pdf -o page.pdf
See the ScreenshotNeo documentation for request options. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents 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 free.
Frequently Asked Questions
Can a full-page Playwright screenshot be saved directly as a PDF?
No. Use page.pdf() to create a PDF; page.screenshot({ fullPage: true }) creates a full-length image.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Does Playwright’s PDF export use print or screen CSS by default?
It uses print CSS media by default. Call page.emulateMedia({ media: 'screen' }) before export when you want screen media rules.
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.

