October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
Chrome Headless

How to Convert HTML to PDF for Free Without an API Key

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.

Yes—you can convert HTML to a PDF without an API key. For a single webpage, open it in Chrome, press Ctrl+P (Windows/Linux) or Command+P (Mac), choose Save as PDF, check the preview, and save. For repeatable jobs, Chrome Headless can print a URL from the command line, while WeasyPrint handles local HTML and Python scripts.

Choose the right free method

Your best route depends on whether you need a one-time file, a command-line workflow, or programmatic control.

Task Recommended route What you need Main caveat
Save one public webpage Chrome print dialog Desktop or Android Chrome Print layout may differ from the screen
Automate URL-to-PDF conversion Chrome Headless Chrome/Chromium installed and a shell Dynamic content may need a suitable wait or timeout
Convert local HTML or use Python WeasyPrint WeasyPrint and its dependencies Unsupported CSS can produce warnings; authentication needs custom fetching
Use a separate command-line renderer wkhtmltopdf wkhtmltopdf installation Its Qt WebKit project documentation is older; verify maintenance and compatibility first

None of these methods requires an API key. They run on your device, so you can inspect the result before distributing it.

Save a webpage as PDF in Chrome

Windows or Linux

  1. Open the webpage in Chrome and wait for the content you need to appear.
  2. Press Ctrl+P, or open Chrome’s three-dot menu and choose Print.
  3. In the print dialog, set the destination to Save as PDF.
  4. Open More settings and review paper size, layout, margins, scale, headers and footers, and background graphics. The exact controls vary by Chrome version and operating system.
  5. Check every page in the preview. Look for clipped columns, unexpected page breaks, missing backgrounds, or blank pages.
  6. Click Save, choose a filename and folder, and confirm.

macOS

  1. Open the page in Chrome and press Command+P.
  2. Choose Save as PDF from the system print dialog’s PDF menu.
  3. Set the page size, orientation, scale, margins, and other available options, then save.

Android

  1. Open the page in Chrome.
  2. Tap More, then Share, then Print.
  3. Select Save as PDF, choose a location, and tap the save control.

Print-to-PDF captures the browser’s printable representation, not necessarily the exact viewport. A responsive page can reflow into a narrow paper layout, and interactive controls, sticky headers, animations, or content loaded only after scrolling may not appear. Always use print preview for important documents.

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

Convert a URL with Chrome Headless

Chrome’s headless mode is useful when a script, scheduled task, or build process must create PDFs without opening a visible browser window. The basic command is:

#1 Best Overall
Sale
Epson Workforce ES-50 Compact & Lightweight Mobile Document Scanner
  • 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
chrome --headless --print-to-pdf=https://example.com/ https://example.com/

On installations where the executable is named differently, use google-chrome, google-chrome-stable, or chromium as appropriate for your system. To choose an output filename, use the output-path form supported by your installed Chrome build, for example:

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

Remove printed headers and footers

Chrome can omit the URL, title, date, and page-number footer/header that may otherwise be added to a PDF:

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

Limit the wait

Use --timeout to put an upper bound on how long the capture waits:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
chrome --headless --timeout=30000 --no-pdf-header-footer --print-to-pdf=/tmp/example.pdf https://example.com/

The timeout is a maximum wait, not proof that a page is finished. A site may render its initial HTML quickly and fetch articles, charts, or images later. For dynamic pages, test a representative URL, select a timeout that allows the slowest expected content, and check the generated PDF. Chrome also documents virtual-time budgeting for pages whose JavaScript depends on elapsed time; that option can make time-dependent rendering more repeatable, but it does not fix a page that requires an interactive login or an unavailable API.

Headless automation checklist

  • Use a fully qualified URL, including https://.
  • Write to a directory where the process has permission.
  • Keep the browser version consistent in CI and production when visual consistency matters.
  • Allow enough time for fonts, images, and client-rendered content.
  • Open a sample PDF after each significant page or stylesheet change.
  • Do not assume a successful process exit means every image or asynchronous component loaded.

Convert local HTML with WeasyPrint

WeasyPrint is designed for print-oriented HTML and CSS. It offers both a command-line interface and a Python API, making it useful for reports generated from local files or templates.

Command line

After installing WeasyPrint according to your operating system’s documentation, convert a local file with:

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)
weasyprint input.html output.pdf

You can also provide a URL or file URL where your installation and security policy allow it:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
weasyprint https://example.com/ output.pdf

Python

from weasyprint import HTML

HTML('https://weasyprint.org/').write_pdf('/tmp/weasyprint-example.pdf')

For a local file, use a file URL or pass the filename:

from weasyprint import HTML

HTML(filename='input.html').write_pdf('output.pdf')

CSS and resource behavior

WeasyPrint is not a full browser engine. Its documentation warns that unsupported CSS properties may generate warnings. Features designed primarily for screen interaction—complex JavaScript applications, some modern layout behavior, video, and browser-specific effects—may not reproduce as they do in Chrome. Keep print styles explicit: define page size and margins, avoid relying on hover states, and use absolute or print-friendly asset URLs where appropriate.

Cookies, authentication, and private pages

WeasyPrint’s default HTTP client does not support advanced features such as cookies or authentication. A custom URL fetcher can supply credentials or retrieve protected resources, but treat that code as security-sensitive. Do not place long-lived secrets in HTML, logs, command history, or a repository. Never process untrusted HTML or CSS without considering the risk of malicious resource requests or excessive resource use.

wkhtmltopdf: a legacy alternative

wkhtmltopdf describes itself as an open-source command-line tool that uses Qt WebKit. A basic invocation is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wkhtmltopdf https://example.com/ output.pdf

It can still be present in older automation systems, but its indexed project homepage and documentation are older than the Chrome and WeasyPrint material described above. Verify that the binary is maintained for your operating system, supports the CSS and JavaScript used by your pages, and meets your security requirements before choosing it for a new project. Do not treat it as automatically equivalent to a current Chromium renderer.

Rank #3
Sale
Epson Workforce ES-400 II High-Speed Color Duplex Desktop Document Scanner
  • FAST DOCUMENT SCANNING — Document scanner with feeder allows you to speed through stacks with a 50-sheet Auto Document Feeder (ADF); Efficient office scanner to help you scan more productively
  • INTUITIVE, HIGH-SPEED SOFTWARE — Quickly scan with this desktop document scanner; Epson ScanSmart Software lets you easily preview scans, email files, upload to the cloud, and more; Plus, automatic file naming saves even more time
  • SEAMLESS INTEGRATION — Easily incorporate your data into most document management software with the included TWAIN driver; Office document scanner integrates seamlessly with business workflows
  • EASY SHARING — Duplex scanner allows you to scan straight to email or popular cloud storage2 services like Dropbox, Evernote, Google Drive, and OneDrive for simple storage and sharing
  • SIMPLE FILE MANAGEMENT — Scanner allows the creation of searchable PDFs with Optical Character Recognition (OCR) and convert scans to editable Word or Excel files effortlessly; Designed for home and office document scanning

Make the PDF readable and predictable

Control page geometry

Paper size, orientation, margins, and scale have more effect on usability than the conversion command itself. Use portrait for text-heavy pages and landscape for wide tables. If a browser preview shows a table split at an awkward point, adjust scale or margins rather than assuming the PDF engine is broken.

Handle backgrounds and images

Some print dialogs disable background graphics by default. Enable them when colored sections or background images carry meaning, but remember that they increase ink usage for physical printing. Large, lazy-loaded images may be absent if the renderer captures before they enter the page. A longer wait, explicit image loading in the page, or a renderer that supports full-page loading can help.

Use print-specific CSS

A @media print stylesheet can hide navigation, expand collapsed sections, remove fixed-position widgets, and set page breaks. Test the same document at several widths because responsive breakpoints can change line wrapping and pagination.

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

Troubleshooting common failures

The PDF is blank

Confirm that the URL is reachable from the machine running the command and that the output directory is writable. For a JavaScript application, increase the wait and check whether content appears only after an API call. A login wall, bot check, certificate error, or blocked resource can also leave a renderer with little to print.

Images or fonts are missing

Inspect the page’s asset URLs and network access. Relative paths in a local file may point to the wrong directory; use a correct base URL. Remote fonts can fail because of connectivity, permissions, or cross-origin policy. Bundle required assets locally when repeatability matters.

Content is cut off or pages break badly

Use print preview, then change paper size, margins, orientation, or scale. Add print CSS for tables and headings, and avoid fixed-height containers that work on screen but clip when printed.

Rank #4
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

The command hangs or takes too long

Set a timeout, identify requests that never finish, and test the page outside the converter. A network-idle assumption can be defeated by analytics, streaming, or long polling. If you control the page, disable nonessential scripts during print generation.

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

WeasyPrint reports unsupported CSS

Read the warning and replace the affected rule with a print-compatible alternative. If the document depends on browser-only behavior, use Chrome Headless instead of trying to force identical output from a different rendering engine.

Private content will not load

Supply authentication in a controlled way. Chrome automation may use a prepared browser profile or request headers, while WeasyPrint may require a custom URL fetcher. Avoid embedding credentials in a URL, and remove temporary cookies and profiles after the job.

Privacy, security, and reliability considerations

Local browser and command-line workflows do not require sending the page to a conversion API, but the page itself can still make network requests while rendering. Review third-party scripts when handling confidential material. Keep generated PDFs and temporary browser profiles protected, and sanitize untrusted HTML before rendering. For production jobs, pin the renderer version, record conversion errors, retain representative test pages, and inspect output after updates.

There is no documented speed or fidelity benchmark here that would justify declaring one free tool universally fastest or most accurate. Rendering engines implement different subsets of HTML, CSS, JavaScript, and web fonts; choose based on the page features you actually use and validate the resulting PDF.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
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 provides a hosted URL-to-PDF option when you prefer one request over maintaining Chrome or another renderer. It accepts a URL and can produce a PDF; its capture options include paper size, margins, landscape mode, and page ranges. Before capture, it can accept cookie/consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets, with each step controllable. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed as clean shots, and the response identifies the result with X-Page-Verdict and X-Billed headers. An MCP server supplies take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

See the ScreenshotNeo documentation for the current request options. A direct cURL request is:

Best Value
Sale
ScanSnap iX2500 Wireless or USB High-Speed Document Scanner, Black
  • OUR MOST ADVANCED SCANSNAP. Large touchscreen, fast 45ppm double-sided scanning, 100-sheet document feeder, Wi-Fi and USB connectivity, automatic optimizations, and support for cloud services. Upgraded replacement for the discontinued iX1600
  • CUSTOMIZABLE. SHARABLE. Select personalized profiles from the touchscreen. Send to PC, Mac, mobile devices, and clouds. QUICK MENU lets you quickly scan-drag-drop to your favorite computer apps
  • STABLE WIRELESS OR USB CONNECTION. Built-in Wi-Fi 6 for the fastest and most secure scanning. Connect to smart devices or cloud services without a computer. USB-C connection also available
  • PHOTO AND DOCUMENT ORGANIZATION MADE EFFORTLESS. Easily manage, edit, and use scanned data from documents, receipts, photos, and business cards. Automatically optimize, name, and sort files
  • AVOIDS PAPER JAMS AND DAMAGE. Features a brake roller system to feed paper smoothly, a multi-feed sensor that detects pages stuck together, and skew detection to prevent paper damage and data loss
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

For PDF output, add the documented PDF option to the same request. The equivalent Python and Node.js request forms are:

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)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

The Free plan includes 1,000 screenshots per month with no card. Paid plans start at $5 for 3,000 shots; yearly billing gives two months free, and every feature is available on every plan. If that fits your workflow, create a free ScreenshotNeo account.

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

FAQ

Can I convert HTML to PDF entirely offline?

Yes, if the HTML and all required assets are local. Chrome Headless, WeasyPrint, and wkhtmltopdf can write a PDF without an API key; pages that depend on remote fonts, images, data, or authentication still need the corresponding network access.

Why does my PDF differ from the webpage?

PDF conversion uses print media rules, paper dimensions, margins, and a particular rendering engine. Responsive breakpoints and unsupported CSS can therefore change pagination, spacing, and appearance.

Which method should I use for a Python report generator?

Start with WeasyPrint when your templates are print-oriented and do not require browser JavaScript. Use Chrome Headless when the page relies on modern browser behavior or client-side rendering, then validate representative outputs.

Frequently Asked Questions

Can I convert HTML to PDF entirely offline?

Yes, if the HTML and all required assets are local. Chrome Headless, WeasyPrint, and wkhtmltopdf can write a PDF without an API key; pages that depend on remote fonts, images, data, or authentication still need the corresponding network access.

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

Why does my PDF differ from the webpage?

PDF conversion uses print media rules, paper dimensions, margins, and a particular rendering engine. Responsive breakpoints and unsupported CSS can therefore change pagination, spacing, and appearance.

Which method should I use for a Python report generator?

Start with WeasyPrint when your templates are print-oriented and do not require browser JavaScript. Use Chrome Headless when the page relies on modern browser behavior or client-side rendering, then validate representative outputs.

Quick Recap

Bestseller No. 4
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.

Read next

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.