Chromium makes a PDF by printing the page as it is rendered in the browser—not by packaging the original HTML file. It loads the URL, runs the page’s JavaScript, lays out the resulting content, and serializes the print output as a PDF. For a quick one-off, use headless Chrome’s --print-to-pdf flag; for automation that needs control over paper, margins, headers, page ranges, or how the PDF bytes are returned, use the Chrome DevTools Protocol method Page.printToPDF.
What Chromium does when it turns a page into a PDF
A browser PDF is the output of a print operation on a loaded page. Chromium first loads the requested URL using its browser and network architecture. It creates a renderer process for the page, executes JavaScript with V8, and lays out the page using Chromium’s web-rendering stack. The print operation then works from that rendered page state.
This distinction matters: the PDF is not simply a download of the original HTML source. If JavaScript changes the page after navigation, the timing of the print operation can affect what appears in the result. The page’s graphics are processed through Chromium’s graphics stack; Chromium’s architecture documentation says that Skia handles images and graphics primitives other than text.
At the output stage, Skia’s PDF backend receives drawing operations and resources for each page. When page drawing is complete, those contents and resources are added to the PDF document; closing the document finishes serialization. The result contains PDF objects and a cross-reference table. Fonts are embedded so the PDF does not depend on the viewing device having the same fonts installed.
Recommended Free Tools
#1 Best Overall
- 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
Save a page from the command line
For a basic headless capture, run:
chrome --headless --print-to-pdf https://example.com/
Chrome saves the result as output.pdf in the current working directory. Run the command from the directory where you want that file to appear, or move the resulting file afterward. This is the shortest route when the default print settings are sufficient.
Control waiting and generated headers
--no-pdf-header-footeromits Chrome’s generated date/time header and URL/page-number footer.--timeout=5000caps the wait before page capture. The value shown is a 5,000-millisecond example, not a guarantee that all page activity will finish.--virtual-time-budget=42000advances virtual time so timer-driven page code can run before capture. The shown value is a 42,000-millisecond example; choose a budget suited to the page’s behavior.
These timing controls address different needs. A timeout limits how long capture waits; a virtual-time budget lets timer-based work advance in the headless page. Neither setting proves that a page’s asynchronous data has finished loading. If the page relies on external services or variable network response times, inspect the PDF and adjust the readiness strategy rather than assuming that a fixed delay guarantees complete content.
Use Page.printToPDF when a script needs print controls
For an automated workflow, a client navigates to the page and calls the Chrome DevTools Protocol method Page.printToPDF. It is the protocol-level way to print the currently rendered page and exposes settings that the basic command-line invocation does not conveniently express.
The method’s print controls include:
- Page layout: paper width and height, margins, and scale.
- Print furniture: whether to display headers and footers, plus header and footer templates.
- Page selection: page ranges.
- Rendered appearance: whether to print background graphics.
- Document structure: whether to generate a document outline.
Use the CLI when a saved file with basic settings is enough. Choose Page.printToPDF when your application must set print options, select pages, or handle the generated bytes itself.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rank #2
- 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⁴
Response data or a stream
The protocol supports two delivery forms. The response can include a base64-encoded data value, which the client decodes to recover the PDF bytes. Alternatively, it can return a stream handle; the client reads that handle through the DevTools Protocol IO domain. Chromium’s browser test exercises both forms, checks the resulting PDF’s page count, and renders a page to a bitmap for verification.
The choice affects how your automation handles output, not how the page is rendered. A base64 response is convenient when the complete result can be carried in a protocol response. A stream is an alternative when the client is set up to read the returned handle through the IO domain.
Make JavaScript-driven pages ready before printing
Printing begins from the page state available at capture time. Navigation reaching a completion event does not, by itself, establish that every later timer-driven or asynchronous update is reflected in the PDF. A page that populates a report after a timer, for example, may need time to advance before printing.
For a simple headless run, Chrome’s --timeout and --virtual-time-budget provide timing controls. The first caps the wait; the second gives timer-driven code a virtual-time allowance. For automated DevTools workflows, decide on a readiness condition before calling Page.printToPDF, based on what the target page actually needs. The protocol’s print settings control the output format; they are separate from the question of whether page content is ready.
Rank #3
- 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.
After producing a PDF, verify pages that are important to the task. Check that expected content appears, that page breaks have not split key material awkwardly, and that any desired backgrounds, headers, or footers are present. For a repeatable capture job, retain a representative output for visual and page-count checks when changing the target page or print settings.
Choose settings based on the PDF’s intended use
- Paper and margins: set paper dimensions and margins explicitly when a particular page format is required; otherwise the output uses the browser’s available defaults.
- Scale: adjust scale when the content needs to fit the selected print layout.
- Backgrounds: enable background printing if the page’s colors or graphics are needed in the document.
- Headers and footers: suppress Chrome’s generated furniture for a cleaner page, or use templates when the automation needs custom header/footer content.
- Page ranges: select ranges when the whole document is not needed.
- Outline: request document-outline generation when that structure is useful to the PDF’s recipients.
These are output choices, not guarantees about the source page’s quality. A print setting cannot make absent page content appear or ensure that a page has finished its own JavaScript work.
Troubleshoot missing, incomplete, or unexpected PDFs
| Symptom | Likely cause | What to try |
|---|---|---|
| There is no PDF where expected | The CLI writes output.pdf in the current working directory, which may not be the directory you expected. |
Check the directory from which Chrome was launched and locate output.pdf there. |
| The PDF is missing content populated by JavaScript | The print operation ran before the page reached the state you wanted. | Use a suitable wait strategy; for timer-driven content, test a virtual-time budget, and inspect the resulting document. |
| The capture takes too long | The page is still loading or waiting on work when capture begins. | Set a timeout appropriate to the job and determine whether the page can be considered ready earlier. A timeout is a cap, not evidence that all content loaded. |
| Chrome’s date, URL, or page numbers appear | Generated header/footer output is enabled. | Use --no-pdf-header-footer for the CLI, or configure displayHeaderFooter for a DevTools print call. |
| The PDF’s paper layout is wrong | The default print layout does not match the intended paper, margins, or scale. | Use Page.printToPDF to set paper dimensions, margins, and scale explicitly. |
| The automation receives a stream handle instead of PDF bytes | The protocol returned the streaming delivery form. | Read the handle through the DevTools Protocol IO domain, or use the base64 data form if that better fits the client. |
Performance, reliability, and cost considerations
The available Chromium documentation does not establish a universal conversion speed, file size, or success rate. Those outcomes depend on the page and capture conditions, so measure them with the URLs and settings that matter to your own workload rather than relying on a general benchmark.
Reliability has two separate parts: whether the page reached the required content state, and whether the PDF was delivered in the form your application expects. Use a readiness approach appropriate to the site, set a bounded wait when needed, and validate representative output. When using the DevTools Protocol, account for whether your client must decode returned base64 data or read a stream handle.
Rank #4
- 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
The documented CLI writes a file locally, while Page.printToPDF gives automation control over options and delivery. The choice affects where your automation work sits and what it must manage; the documentation cited here does not provide a comparative infrastructure-cost figure.
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. Its API can return a PNG, JPEG, WebP, or PDF; this example uses the supplied one-request screenshot call and saves an image:
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 documentation for the API options, including PDF output. Cookie banners are accepted before capture and more than 60 known consent platforms, newsletter popups, and chat widgets can be removed; each of those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers report the page verdict and billing status. An MCP server offers AI agents screenshot, page-info, and PDF-capture tools. The free plan includes 1,000 shots a month with no card; paid plans start at $5 for 3,000 shots.
Sign up free for 1,000 screenshots a month with no card.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →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.

