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.

The right HTML-to-PDF tool depends on how you work. Use a browser’s Print command for a one-off page, Puppeteer when your application must generate repeatable PDFs, Acrobat when you need interactive conversion controls, a command-line engine for an existing deployment, or a hosted API when you do not want to operate browsers yourself. No available evidence establishes one universal winner, so choose by rendering control, accessibility, deployment, maintenance, and volume.

Choose a conversion route

Route Best fit What it provides Important qualification
Browser print dialog Occasional, manual saves Immediate page-size, orientation, margin and destination controls Results depend on the browser, page print CSS and the user’s settings
Puppeteer Repeatable generation in JavaScript or Node.js Chromium rendering, print CSS, scripted waits and PDF options No independent speed or fidelity benchmark is established here
Adobe Acrobat Desktop users who need conversion controls Layout, encoding, colors, bookmarks, tags, page size, orientation, margins and scaling Operating workflow and licensing depend on your Acrobat edition
wkhtmltopdf Existing command-line or server deployments Headless Qt WebKit HTML-to-PDF/image conversion under LGPLv3 The project page reviewed is old-crawled; current maintenance and modern CSS compatibility are not established
Hosted API Applications that prefer an external conversion service Remote HTML, URL, ZIP or dynamic-page conversion without browser operations in your infrastructure Check current limits, privacy terms and regional availability before committing

Convert HTML with Puppeteer

Puppeteer’s Page.pdf() method generates a PDF using the print CSS media type by default (Puppeteer API documentation). If your screen layout should be preserved instead, call page.emulateMediaType('screen') before creating the PDF. Chromium also modifies colors for printing by default, so explicitly preserve backgrounds when your design requires them.

Install and run a complete example

  1. Install Node.js and create a project: mkdir html-pdf && cd html-pdf && npm init -y.
  2. Install Puppeteer: npm install puppeteer.
  3. Save this as convert.mjs, replacing the URL with a page you control or are authorized to retrieve.
  4. Run node convert.mjs; the result is written to output.pdf.
import puppeteer from 'puppeteer';

const browser = await puppeteer.launch({
  headless: true
});

try {
  const page = await browser.newPage();
  await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
  await page.goto('https://example.com', {
    waitUntil: 'networkidle2',
    timeout: 90000
  });

  // Use this only when the screen stylesheet, not print CSS, is desired.
  // await page.emulateMediaType('screen');

  await page.evaluate(() => document.fonts.ready);
  await page.pdf({
    path: 'output.pdf',
    format: 'A4',
    printBackground: true,
    margin: {
      top: '16mm',
      right: '16mm',
      bottom: '18mm',
      left: '16mm'
    },
    preferCSSPageSize: true,
    displayHeaderFooter: false
  });
} finally {
  await browser.close();
}

The guide’s example uses networkidle2, but readiness is an application decision: analytics, advertisements or live sockets can keep a page active indefinitely. A page-specific selector wait or a short, bounded delay can be more reliable for dynamic content.

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

Control print layout with CSS

@media print {
  .navigation, .cookie-banner, .chat-widget { display: none !important; }
  a { color: #000; text-decoration: none; }
  h1, h2, h3 { break-after: avoid; }
  .invoice { break-inside: avoid; }
}

@page {
  size: A4;
  margin: 16mm;
}

preferCSSPageSize: true lets an author’s @page rule control the paper size. Without it, the PDF option such as format: 'A4' is the primary size setting. Use CSS page and break rules deliberately for invoices, reports and repeating sections.

#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

Fonts, images and dynamic content

  • Puppeteer documents that font loading is awaited by default, and the example additionally waits on document.fonts.ready so the intent is explicit.
  • Confirm that web fonts, images and CSS are reachable from the conversion environment. Relative assets should resolve from the page’s actual URL.
  • For lazy-loaded images, scroll or trigger the page’s loading mechanism before calling page.pdf(); otherwise the PDF can contain placeholders.
  • Wait for a meaningful application signal, such as #report-ready, rather than assuming a generic network-idle event is correct.

Useful PDF options

  • format, or width and height, sets the paper dimensions.
  • landscape: true rotates the page.
  • margin accepts CSS lengths for each edge.
  • printBackground: true retains background colors and images that printing would otherwise omit.
  • pageRanges limits output to selected pages.
  • scale adjusts rendered size, while CSS remains the better place for structural layout.
  • displayHeaderFooter and its templates add page metadata when required.

Save a page with a browser’s Print command

For a single document, open the page and choose Print (often Ctrl+P or Cmd+P), then select Save as PDF. Review destination, paper size, portrait or landscape orientation, margins, scale, background graphics and headers or footers. A page can provide a dedicated print stylesheet, so the preview—not the screen view—is the authoritative check.

Manual printing is the least operationally complex route, but it is not deterministic: different browsers, profiles and saved settings can produce different pagination. It also requires a person for every conversion.

Use Acrobat’s HTML conversion controls

Adobe documents conversion controls for layout, character encoding, colors, bookmarks, PDF tags, page size, orientation, margins, scaling and scrollable content (Adobe Acrobat web-page conversion help, updated September 23, 2025).

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

A practical Acrobat workflow

  1. Open Acrobat’s web-page conversion command and provide the page address or HTML source according to your edition.
  2. Set page dimensions, orientation, margins and scale-to-fit behavior before conversion.
  3. Choose whether to retain background colors and images, and select the required encoding.
  4. Enable bookmarks and PDF tags when preserving navigation or accessibility structure matters.
  5. Expand scrollable regions when content hidden inside a scrolling panel must appear in the PDF.
  6. Inspect the converted file for clipped columns, missing fonts, page breaks, link behavior and tagged structure before distribution.

Acrobat is convenient for human-directed work and exposes controls that are easy to review visually. The available documentation does not establish how its output compares in speed or fidelity with Puppeteer or other engines.

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)

Command-line conversion with wkhtmltopdf

The wkhtmltopdf project describes a headless command-line converter based on Qt WebKit that can produce PDF or images and is licensed under LGPLv3 (wkhtmltopdf project). A basic invocation is:

wkhtmltopdf --print-media-type --enable-local-file-access input.html output.pdf

Use --print-media-type when your stylesheet has a print-specific layout. --enable-local-file-access can expose local assets, so restrict inputs and filesystem permissions in multi-tenant systems. The reviewed project page is old-crawled; verify the current release, security posture and CSS support before adopting it for a new build. Modern layouts may rely on browser capabilities that a Qt WebKit engine does not provide.

Hosted HTML-to-PDF APIs

A hosted service can accept HTML or a URL and return a PDF, avoiding browser installation, sandboxing and scaling work in your application. Adobe PDF Services documents conversion from static HTML, dynamic HTML, ZIP files and URLs (Adobe PDF Services documentation). Its pricing page lists a vendor-published allowance of 500 free Document Transactions per month, with paid plans; verify the current terms before relying on that number (Adobe PDF Services pricing).

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

Before sending documents to any hosted API, confirm whether HTML, assets and generated PDFs are retained, where processing occurs, how authentication works, and whether your compliance requirements permit external processing. Also check limits for file size, page count, concurrent jobs, URL access and dynamic JavaScript.

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

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. It is useful when the deliverable is a clean visual capture rather than a typeset, selectable-text PDF; its API returns PNG, JPEG or WebP, while its MCP server includes a capture_pdf tool for AI-agent workflows. A single request looks like this:

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

See the ScreenshotNeo documentation for PDF capture and the other request options. Before capture, it accepts cookie or consent banners and removes more than 60 known consent platforms, newsletter popups and chat widgets; each cleanup step can be disabled. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads and cache hits are not billed, and response headers identify the page verdict and billing status. AI agents can call its MCP tools take_screenshot, get_page_info and capture_pdf.

The Free plan includes 1,000 shots per month with no card. Paid plans start at $5 for 3,000 shots; every feature is included on every plan. Create a free ScreenshotNeo account to try it without a card.

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

Troubleshooting HTML-to-PDF conversion

Blank or partially rendered pages

Check the URL, authentication and network access from the conversion host. In Puppeteer, log the response status, increase the navigation timeout within a bounded limit, and wait for an application-ready selector. A bot check or client-side error may be the real page content.

Missing backgrounds or colors

Enable printBackground: true in Puppeteer or the equivalent browser print option. If the screen stylesheet is required, emulate screen media before calling page.pdf(); otherwise print CSS is used.

Rank #4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
  • 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

Wrong page breaks or clipped wide content

Set an explicit paper size and margins, use @page, and remove fixed-width containers in print CSS. For Acrobat, adjust scale-to-fit and orientation. Recheck tables and scrollable panels in the PDF preview.

Fonts or icons are missing

Ensure font files and icon resources are reachable without an interactive login, wait for font readiness, and verify that the deployed environment has the same certificates and network policy as development.

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

Conversion never finishes

Long-polling, advertisements and WebSockets can defeat network-idle waits. Prefer a selector that signals completion, abort requests you do not need, and enforce a total timeout so failed jobs are retried or reported instead of consuming workers indefinitely.

Local files expose sensitive data

Do not enable local-file access for untrusted HTML unless it is isolated. Run conversion with least-privilege filesystem permissions, validate URLs, and separate tenants or jobs in containers or equivalent sandboxes.

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

Production checklist

  • Define whether output should follow print CSS or screen CSS.
  • Specify paper size, margins, orientation, scale and background behavior.
  • Wait for fonts, images and application data—not merely an arbitrary delay.
  • Test representative long pages, tables, RTL text, links and page breaks.
  • Decide whether bookmarks, PDF tags and selectable text are required.
  • Bound navigation, rendering and queue times and record failures with the source URL.
  • Pin your browser or converter version and review changes before deployment.
  • For hosted services, verify current pricing, retention, limits, region and compliance terms.

Frequently Asked Questions

Can I convert an HTML string instead of a URL with Puppeteer?

Yes. Create a new page, call page.setContent(html, { waitUntil: 'networkidle0' }), wait for fonts and application assets, then call page.pdf(). Resolve or inline relative images, stylesheets and fonts because there may be no document URL from which to resolve them.

Does a PDF preserve HTML interactivity?

Usually not. JavaScript controls, hover states, form behavior and live data become a static document. Export the state users should see, and add PDF links or form fields separately when needed.

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.

Which option is cheapest?

A browser’s built-in Print command has no separate conversion service cost. Automated and hosted costs depend on infrastructure and vendor terms; the available sources do not provide a comparable total-cost benchmark.

How should I handle confidential HTML?

Prefer an isolated, self-hosted browser when policy prohibits external processing. If using a hosted API, review its retention, processing location, access controls and contractual terms before transmitting data.

Quick Recap

Bestseller 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
$184.00
Bestseller No. 4
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
IRIScan Express 4 Black Compact Portable USB Simplex Document Scanner, 8 PPM for Contracts, Invoices and Business Cards, Compatible with Windows, Readiris PDF Included
Find our Software here : irislink.com/start; IRIScan Express is only compatible Windows platform and not macintosh
$129.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.