DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PC×
Skip to content
World desk6 min

How to Get a PDF of a Webpage from a Screenshot API

Use a screenshot API’s PDF mode when available; otherwise render the webpage with Puppeteer or Playwright, accounting for print CSS, layout, and dynamic content.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Check whether the screenshot API offers PDF output or a dedicated PDF endpoint; if it does, use its documented PDF settings and save the response as a PDF. If it only returns images, use browser automation such as Puppeteer or Playwright to render the page as a PDF. A PDF is a paginated print-style rendering, not necessarily a pixel-for-pixel copy of a screenshot.

Choose direct PDF output or browser automation

For a hosted service, look in its API reference for an output format such as pdf or a dedicated URL-to-PDF endpoint. The request parameters, authentication, and response format are provider-specific: the result may be PDF bytes or a URL/redirect. Follow the provider’s own example rather than assuming all screenshot APIs behave alike.

As an Amazon Associate I earn from qualifying purchases.

For example, ScreenshotEngine’s API reference documents an output: "pdf" option, paper size, and orientation. ScreenshotAPI.net’s documentation describes a PDF route for URL or raw HTML input, with print-related settings and dynamic-content controls. Check each provider’s current documentation for exact endpoint and parameter names.

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

If your provider only returns image bytes, generate the PDF in a browser runtime instead. Puppeteer and Playwright expose page-level PDF generation; this renders the page as a document rather than simply wrapping one screenshot image in a PDF.

#1 Best Overall
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 a screenshot API’s PDF mode

  1. Confirm the input and output. Check whether the endpoint accepts a webpage URL, raw HTML, or both, and whether PDF is a supported output.
  2. Set the document layout. Configure paper size, orientation, margins, scale, page ranges, and background graphics where available. Not every API supports every control.
  3. Set readiness behavior. If the page loads content dynamically, use the provider’s documented wait, delay, or other readiness options so the content is present before rendering.
  4. Save the result according to the response shape. If the endpoint returns PDF bytes, write the response body to a .pdf file. If it returns a URL or redirect, retrieve the PDF from the documented location instead.
  5. Open and inspect the PDF. Check page breaks, missing images, colors, and whether the chosen print styling matches what you intended.

Generate a webpage PDF with Puppeteer

Puppeteer’s Page.pdf() generates a PDF using print CSS by default. Its documentation says to call page.emulateMediaType('screen') first if the PDF should use screen media instead. The example below saves the default print-style rendering to disk.

Puppeteer Page.pdf() API documentation · Puppeteer PDF generation guide

import puppeteer from 'puppeteer';

const url = 'https://example.com';
const browser = await puppeteer.launch({ headless: true });

try {
  const page = await browser.newPage();
  await page.goto(url, { waitUntil: 'networkidle2' });

  await page.pdf({
    path: 'page.pdf',
    format: 'A4',
    printBackground: true,
    margin: { top: '12mm', right: '12mm', bottom: '12mm', left: '12mm' }
  });
} finally {
  await browser.close();
}

Puppeteer’s PDF documentation notes that Page.pdf() waits for fonts by default. A network-idle navigation condition can be unsuitable for pages that keep connections open or load content later; for those pages, wait for a meaningful selector or the specific content you need before generating the PDF.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
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

To use screen CSS instead of print CSS, add this before page.pdf():

await page.emulateMediaType('screen');

Print rendering can alter colors. Puppeteer documents -webkit-print-color-adjust as a way for page CSS to request exact colors, but the site’s styles and browser rendering still affect the result.

Generate a webpage PDF with Playwright

Playwright’s page.pdf() returns PDF data that you can write to a file. Its page API documents print-media behavior and layout options including paper format, dimensions, margins, scale, and printBackground.

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

Playwright Page.pdf() API documentation

import { chromium } from 'playwright';
import { writeFile } from 'node:fs/promises';

const url = 'https://example.com';
const browser = await chromium.launch({ headless: true });

try {
  const page = await browser.newPage();
  await page.goto(url, { waitUntil: 'networkidle' });

  const pdf = await page.pdf({
    format: 'A4',
    printBackground: true,
    margin: { top: '12mm', right: '12mm', bottom: '12mm', left: '12mm' }
  });
  await writeFile('page.pdf', pdf);
} finally {
  await browser.close();
}

Like Puppeteer, Playwright uses print styling for PDF generation by default. If you want screen media, select it before calling page.pdf():

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
await page.emulateMedia({ media: 'screen' });

Use one browser library rather than running both unless your application has a specific need for separate runtimes. Both require you to manage a compatible browser runtime, while a hosted endpoint avoids that browser setup but offers only the controls its API documents.

Make the PDF match the intended result

Print layout versus screen appearance

A screenshot captures a viewport or page as an image; a PDF renderer lays content out across pages. Print CSS, pagination, and color handling can therefore make the PDF look different from a screenshot. ScreenshotEngine explicitly notes that its PDF uses print styling and may look different from a screenshot. If screen styling matters, choose a tool that supports screen media or use the browser-library setting documented above.

Rank #4
Sale
MUNBYN Portable Scanner, 900 DPI Handheld Wand Scanner, A4, 16GB SD, Black
  • 【Easy to Carry--Portable Scanner】Length: 9.5 in = 1.5 pens. Weight: 0.66 lbs = An apple. Carry way: Small bag. Power Source: a pair of AA batteries (NEED TO BUY EXTRA). Support scanning up to A4 size.
  • 【Easy to Scan--Handheld Scan】Portable Scanner scans your photos, documents, and book pages in 3-5 seconds on 900 dpi resolution independently. Easy to use once you take a tiny bit of time to get the hang of this portable scanner. Compared to the feeding scanner, the wand scanner will not fold or damage old photos during scanning.
  • 【Easy to use--No Driver】Portable Scanner does not require downloading a driver. Easily connect the portable scanner to a computer through a USB cable to transfer your scanned photos or documents anywhere and anytime.
  • 【Easy to Digitalize--Clear Image】The highest 900dpi scan resolution can convert pictures, documents, book pages, or other targets into digital files in high clarity.
  • 【Easy to Store--16G SD Card】Wand scanner with 16G SD card will store thousands of scan files. With OCR software (you can find some software from Google Play Store), easy to transfer PDF scan files into Word/Excel format and edit them.

Paper, margins, and page breaks

Choose paper size and orientation for the content, then set margins and scale deliberately. Wide tables or dashboards may need landscape orientation or a smaller scale; long pages may break differently depending on print CSS. Preview the output rather than assuming a single-page screenshot will map neatly onto paper.

Backgrounds and color

Enable background printing when the document needs background colors or images. Browser print rendering may still adjust colors; Puppeteer documents CSS -webkit-print-color-adjust for requesting exact colors.

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

Dynamic content and fonts

Wait for the page content that matters, not merely the initial navigation. Use a selector or explicit delay when the page renders asynchronously, and ensure required assets have loaded. Puppeteer says its PDF method waits for fonts by default; hosted APIs may expose their own wait controls.

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
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

ScreenshotNeo can return a PDF from one GET request. Its PDF options include paper size, margins, landscape, and page ranges. For example, this cURL request captures a PDF of the target webpage; replace the URL and API key with yours. See the ScreenshotNeo API documentation for available parameters.

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

ScreenshotNeo’s cookie/consent handling removes known consent banners, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server offers take_screenshot, get_page_info, and capture_pdf tools for AI agents. The Free plan includes 1,000 shots per month with no card; paid plans start at $5 for 3,000 shots.

Sign up for ScreenshotNeo’s free plan to try 1,000 screenshots a month with no card.

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

Troubleshoot common PDF problems

  • The response is not a PDF. Confirm that the API accepts the PDF output parameter you sent and whether it returns raw bytes, a redirect, or a downloadable URL. Save or follow the response as its documentation specifies.
  • The PDF looks different from the screenshot. Check whether the renderer uses print CSS. Select screen media if supported and intended; otherwise adjust the page’s print styles and inspect the resulting pagination.
  • Colors or backgrounds are missing. Enable the renderer’s background-print option. For Puppeteer, consider the documented -webkit-print-color-adjust CSS request for exact colors.
  • Images, fonts, or other content are missing. Wait for the relevant assets or page content before rendering. Use an explicit selector or delay for asynchronous pages; for API services, use their documented wait controls.
  • The job hangs or times out. A page may keep network connections open, making a network-idle condition a poor readiness test. Wait for the specific content needed, and check the service’s timeout and response details.
  • Content is clipped or breaks awkwardly. Review paper format, orientation, margins, scale, and print CSS. A PDF paginates content, so adjust layout rather than expecting it to behave like a single image.

Frequently Asked Questions

Can a PDF from a screenshot API look exactly like a screenshot?

Not necessarily. PDF rendering uses page layout and may use print CSS, so it can differ from a screenshot image.

Can I make a PDF use screen CSS instead of print CSS?

Yes, when using Puppeteer or Playwright, emulate screen media before calling the page’s PDF method.

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. 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 *

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.

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
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.