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

Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.

Chromium converts a web page to PDF by printing the page after it has been rendered. It navigates to the URL, loads resources through its browser process, runs JavaScript in a renderer, lays out the resulting document, and sends the page’s drawing operations to Skia’s PDF backend. The simplest headless command is chrome --headless --print-to-pdf https://example.com/. For automation, Chrome DevTools Protocol (CDP) exposes the same print operation through Page.printToPDF, with controls for paper size, margins, headers, backgrounds, page ranges and output delivery.

The conversion pipeline: URL to PDF bytes

A Chromium PDF is a printout of the page state that exists when printing begins. It is not a download of the original HTML source. Chromium’s browser and network architecture fetch the document and its subresources, while a renderer process executes JavaScript with V8 and builds the DOM, CSS style tree and layout. The graphics layer then prepares text, images and other drawing primitives.

1. Navigation and resource loading

Chromium first resolves the URL, follows navigation rules and requests stylesheets, scripts, fonts, images and other resources. Network traffic is handled by Chromium’s multiprocess resource-loading system rather than directly by the renderer. This separation lets the browser apply security, caching and request policies while the renderer concentrates on the document.

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

2. JavaScript and layout

V8 runs page scripts, including code that fetches API data or inserts content after the initial response. Chromium calculates styles, measures boxes, places text, paints backgrounds and resolves images. Graphics uses Skia, a cross-platform library that handles images and graphics primitives except for text. The result is a fully rendered visual state, not merely a source snapshot.

#1 Best Overall
Epson EcoTank ET-2800 Wireless Color All-in-One Supertank Printer - Black
  • INNOVATIVE CARTRIDGE-FREE PRINTING — No more dealing with lots of tiny ink cartridges; With this wireless document and photo printer each ink bottle set is equivalent to about 90 individual cartridges²
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; When you choose this combination printer, scanner and copier you can print up to 4,500 pages black/7,500 color³
  • COLOR PRINTING — Up to 2 years of ink in the box4 (and with every replacement ink set) for fewer out-of-ink frustrations
  • ZERO CARTRIDGE WASTE — By using an Epson EcoTank printer you can help reduce the amount of cartridge waste ending up in landfills
  • HOME PRINTER DESIGNED FOR RELIABILITY — The Epson EcoTank ET-2800 All-in-One Supertank Color Printer creates vivid, detailed prints and documents thanks to Micro Piezo Heat-Free Technology; Fire off 10 ISO pages per minute1 to easily finish large jobs

3. Print and serialization

Printing converts that rendered state into page-sized drawing operations. Skia’s PDF device collects each page’s content and resources in a PDF document. When the final page closes, Skia serializes PDF objects and a cross-reference table. Fonts are embedded because a viewer cannot be assumed to have the original fonts installed; embedding preserves text appearance on another machine.

Fastest method: headless Chrome’s command line

With Chrome or Chromium installed and available as chrome, run:

chrome --headless --print-to-pdf https://example.com/

The command writes output.pdf in the current working directory. Use a writable directory or an absolute executable path when Chrome is installed elsewhere.

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.

Control generated headers and footers

Chromium adds print furniture—typically the date, URL and page number—unless you disable it:

chrome --headless --no-pdf-header-footer --print-to-pdf=https://example.com/

The equals form is useful when combining the flag with scripts; both forms express the same operation. Removing the furniture does not remove headers or footers authored by the page itself.

Limit waiting time

Set a capture ceiling with --timeout, expressed in milliseconds:

chrome --headless --timeout=5000 --print-to-pdf=https://example.com/

A timeout prevents a hung navigation from waiting indefinitely, but it can also cut off legitimate asynchronous work. Choose it according to the page’s normal loading behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
Sale
Epson EcoTank Photo ET-8550 Wireless Wide-Format All-in-One Tank Printer
  • CARTRIDGE-FREE PRINTING — Print lab-quality photos, graphics and creative projects; Get vibrant colors and sharp text with Epson's high-accuracy printhead and Claria ET Premium 6-color inks
  • INK BOTTLES — Save on photos1 and creative projects with affordable in-house printing; All-in-one printer allows you to print 4" x 6" photos for about 4 cents each vs. 40 cents with traditional ink cartridges1
  • LESS FREQUENT INK REPLACEMENT — Replacement ink bottles don't have to be changed nearly as often as ink cartridges¹; Printer, scanner and copier lets you print up to 6,200 color pages³
  • PRINT FOR LONGER — Up to 2 years of ink in the box² (and with every replacement ink set) for fewer out-of-ink frustrations with this wireless printer
  • ZERO CARTRIDGE WASTE — Epson EcoTank printer helps reduce the amount of cartridge waste ending up in landfills; Cartridge-free printer uses high-yield ink bottles; Each replacement ink bottle set is equivalent to about 100 individual ink cartridges⁴

Advance timer-driven pages

Some applications reveal content only after timers run. A virtual-time budget allows page timers to advance before printing:

chrome --headless --virtual-time-budget=42000 --print-to-pdf=https://example.com/

Virtual time is not a guarantee that network requests or application jobs have completed. Pair it with page-specific readiness logic when possible.

Automation with Page.printToPDF

CDP is the automation interface for applications that need more than a single output file. A client launches Chromium with remote debugging enabled, navigates a tab, waits for the page to be ready, then calls Page.printToPDF. The method can return PDF data as base64 or a stream handle that the client reads through the IO domain.

Minimal CDP sequence

  1. Start Chromium with a debugging port, for example chrome --headless --remote-debugging-port=9222 about:blank.
  2. Connect to the browser’s WebSocket endpoint and create or select a page target.
  3. Enable the Page domain and navigate to the URL.
  4. Wait for navigation and any application-specific asynchronous work.
  5. Call Page.printToPDF with print options.
  6. Decode the returned data value from base64, or read the returned stream with the IO domain, then write the bytes to disk.

Important print options

Option What it controls
displayHeaderFooter Whether Chromium renders its generated header and footer templates.
headerTemplate, footerTemplate HTML templates for print headers and footers when they are enabled.
paperWidth, paperHeight Paper dimensions, in inches.
marginTop, marginBottom, marginLeft, marginRight Print margins, in inches.
scale Scaling applied to printed content.
printBackground Whether CSS backgrounds and colors are included.
pageRanges Pages to emit, such as a selected range rather than the whole document.
generateDocumentOutline Whether Chromium asks for a document outline based on the page structure.

These controls make CDP preferable when you need a particular paper format, branded templates, background colors, selected pages or machine-readable delivery rather than a file in the current directory.

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

Readiness: why JavaScript timing changes the PDF

“Navigation finished” and “application finished” are different events. A single-page app may return its initial document quickly, then fetch data, render charts, lazy-load images or replace placeholders. Printing too early captures that intermediate state.

Practical readiness strategies

  • Wait for a selector that appears only after the main data render, such as a report container.
  • Wait for a known application signal, such as a completed network request or a JavaScript flag.
  • Use a bounded delay only when the page has predictable timing.
  • Use a virtual-time budget for timer-driven code, while remembering that it does not replace network readiness checks.
  • Ensure lazy images are actually loaded before printing; otherwise blank image boxes can become part of the PDF.

For repeatable output, make readiness a page-specific contract instead of relying solely on a large global timeout.

What the PDF contains—and what it does not

The output contains the visual result Chromium could print: text, positioned elements, images, colors and other painted resources, subject to the selected print settings. It does not preserve the original DOM as an editable web application. Interactive behavior, live network calls and event handlers do not continue inside a static PDF. Fonts are embedded for portability, but a viewer still needs to support the PDF features used by the file.

Rank #3
HP Smart Tank 5000 Wireless All-in-One Ink Tank Printer, Scanner, Copier with 2 Years of Ink Included, Best-for-Home, Cartridge-Free, Refillable and AI-Enabled. (5D1B6A)
  • SET IT UP ONCE AND PRINT WITH CONFIDENCE. No complicated maintenance. Just easy, reliable printing you can count on.
  • INK FOR YEARS. NOT MONTHS. Up to 2 years of ink included. Get thousands of pages of cartridge-free printing. More pages, less hassle
  • KEEPS PRINTING WELL AFTER COMPETITORS HAVE QUIT. No complex maintenance. Sharper text, richer colors.[2] Only with HP Smart Tank
  • PREMIUM SUPPORT - Strong technical expertise to solve issues faster
  • THE LAST PRINTER YOU'LL EVER NEED. Enjoy years of refillable, cartridge-free printing.

Choosing CLI, CDP or a hosted API

Workflow Best for Trade-off
Headless CLI One-off jobs and simple scheduled captures Few controls and local browser management.
CDP Page.printToPDF Applications requiring print settings, readiness logic or streaming You must operate a browser connection and handle failures.
Hosted screenshot/PDF API Teams that want an HTTP interface without browser setup Requires an API account and request-based billing.

Troubleshooting Chromium PDF output

The PDF is blank or missing data

Cause: printing began before JavaScript completed, or the page failed to load. Fix: wait for a post-render selector or application signal, increase the bounded timeout, and inspect the page in a normal browser to confirm that the data is reachable.

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

Images are absent

Cause: lazy loading, blocked requests or an image that had not finished decoding. Fix: scroll or trigger the page’s lazy-load mechanism, wait for image completion, and verify request permissions before calling print.

Unexpected date, URL or page numbers appear

Cause: Chromium’s generated header/footer is enabled. Fix: use --no-pdf-header-footer on the CLI or set displayHeaderFooter to false in CDP.

Colors or backgrounds disappear

Cause: print-background output is disabled or the page’s print CSS changes the design. Fix: enable printBackground in CDP and inspect print media styles.

The process hangs

Cause: a navigation, script or resource never settles. Fix: apply --timeout or an application-level deadline, terminate the browser cleanly, and retry only idempotent work.

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

CDP returns data but the file cannot be opened

Cause: base64 was written as text instead of decoded bytes, or a stream was not fully read. Fix: base64-decode the data field as binary, or consume the IO stream until its end before closing it.

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

Performance, reliability and cost considerations

Chromium has to pay the cost of navigation, JavaScript execution, layout, painting and PDF serialization for each capture. Reusing a browser process can avoid repeated startup overhead, while isolating jobs in separate contexts limits cookies and state leakage. Bound every navigation and print operation, record whether readiness succeeded, and retain diagnostic logs for failed jobs. There is no universal speed or file-size figure: page complexity, fonts, images, network conditions and print settings dominate the result.

Rank #4
NDYIN Portable Printers Wireless for Travel, N80 Bluetooth Thermal Printer
  • Wireless Bluetooth Printer: Portable thermal printer compatible with iPhone, Android phones, iPad and tablet computers via Bluetooth. For smartphones, please download the "Nada Print" App. You can also connect to laptops and computers for printing using a USB-C cable. (Note: Laptops and computers can only be connected via USB and require the installation of a driver first. Bluetooth connection is not supported.)
  • No-ink printing: Only supports US Letter and A4 size thermal paper.(Doesn't support regular paper) The no-ink portable thermal printer uses direct thermal technology, requiring no ink, toner or ribbons, making it environmentally friendly, cost-effective and time-saving. The thermal printer package comes with a roll of US Letter thermal printing paper. Note: When installing the paper, remember to switch the paper size switch on APP
  • Clear Print: NDYIN N80 portable thermal printer adopts high-definition printing technology, with a 203DPI resolution to provide you with clear printing results. This mobile printer is compatible with roll paper, folded paper and tattoo transfer paper, supporting printing from your mobile phone PDF, Word, pictures and web pages anytime and anywhere. It is recommended to use our NDYIN thermal paper to achieve good printing quality
  • Portable wireless printer for travel: The thermal printer is equipped with a built-in 1500mAh rechargeable battery, which can print 160 sheets of 8.5" x 11" thermal paper after being fully charged. It weighs only 1.5 pounds and is compact in size. This ink-free portable printer can be easily carried in a backpack or briefcase! It is perfect for business travel, cars, small offices, construction sites, schools and homes. You can print documents, contracts, invoices and boarding passes anytime and anywhere
  • The N80 thermal printer has a wide range of uses. The package includes the N80 printer, a roll of US Letter paper(7m/roll), a user manual, a guide card, a type-C soft cable and a type C adapter. Note: The charging adapter is not included. Special thermal paper is required for use; ordinary paper cannot be used. This ink-free portable thermal printer is suitable for various scenarios such as home, school, travel, office, and outdoor, meeting the printing needs of different groups of people. This tattoo template printer is also compatible with tattoo transfer paper, making it an ideal choice for tattoo art

Or skip the browser setup

ScreenshotNeo provides a hosted HTTP endpoint for screenshots and PDFs. It accepts consent banners before capture and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Only clean shots are billed: bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits cost nothing, and response headers identify the page verdict and billing status. Its MCP server gives Claude, Cursor and other MCP clients tools named take_screenshot, get_page_info and capture_pdf.

See the ScreenshotNeo API documentation for request options. A PDF request can use the same endpoint shown below, with the target URL adapted to your page:

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://stripe.com -o shot.webp

Python:

import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)

Node.js:

const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Every plan includes its features: full-page capture, lazy-image loading, CSS-selector element capture, dark mode, device presets, custom viewport and retina scale, PDF paper and page controls, custom CSS and JavaScript, clicks, waits, request blocking, headers, cookies, user agents, authorization, timezone, geolocation, transparent backgrounds, resizing, TTL caching, signed links, asynchronous webhooks, bulk capture of up to 100 URLs per call, usage data and an OpenAPI specification. The parameter names used by other screenshot APIs also work, easing migration.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing provides two months free. Create a free ScreenshotNeo account to start.

Frequently Asked Questions

Does Chromium print the live page or the original HTML?

It prints the rendered page state at the moment the print operation runs, after navigation, script execution, style calculation and layout.

Can Page.printToPDF return a file directly?

It returns PDF bytes as base64 data or a stream handle; your client writes or streams those bytes to a file.

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

Why are fonts embedded in Chromium PDFs?

Embedding avoids depending on fonts installed on the machine that later opens the PDF.

Is virtual time the same as waiting for network idle?

No. Virtual time advances timers; it does not prove that asynchronous network work or application rendering has finished.

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.