ScreenshotNeo

BlogHTML to image & PDF

How to Convert HTML to PDF on Windows 10

Convert HTML to PDF on Windows 10 with Edge, Firefox, Microsoft Print to PDF, print CSS, troubleshooting, and automation options.

By the ScreenshotNeo team1 October 20266 min read

Quick answer: Open the HTML page in Microsoft Edge, press Ctrl+P, choose a PDF destination or Microsoft Print to PDF, review the preview, then select Print and save the file. Firefox offers the same workflow with a Save to PDF destination.

Preview before saving. Scale, backgrounds, headers, footers, margins, and page breaks determine what appears in the PDF.

1. Convert HTML to PDF in Microsoft Edge

  1. Open the local .html file or web page in Edge.
  2. Press Ctrl+P, select Print from the three-dot menu, or right-click the page and choose Print. See Microsoft’s Edge print guide.
  3. Choose a PDF destination. If none appears, select Print using system dialog, then choose Microsoft Print to PDF.
  4. Set paper size, orientation, margins, scale, and headers or footers. Enable Background graphics when colors, charts, or background images are required.
  5. Review several pages in the preview, select Print, choose a folder, enter a filename ending in .pdf, and select Save.

To print only part of a document, select the text or images, right-click the selection, and choose Print. Edge’s Immersive Reader can remove surrounding navigation and ads when it is available for the site.

2. Choose settings that preserve the layout

Setting Use it when Check
Layout The page is wider than tall Try Landscape for dashboards and wide tables.
Paper size The PDF will be printed or submitted Match Letter or A4.
Scale Columns are clipped or too small Try Fit to printable area, Actual size, or a custom percentage.
Margins Content touches the edge Use a preset or custom margin and recheck wrapping.
Background graphics Color bands, charts, or background images matter Enable this option.
Headers and footers You need a title, URL, date, or page numbers Enable only when those fields belong in the deliverable.

After saving, reopen the PDF and verify links, fonts, images, page count, and the first and last page.

3. Use Firefox on Windows 10

  1. Open the page in Firefox and press Ctrl+P.
  2. Open the destination menu and choose Save to PDF.
  3. Set the page range, orientation, scale, margins, and headers or footers.
  4. Select Save and choose the output path.

Mozilla documents this workflow in How to print web pages in Firefox. The two browsers can paginate the same HTML differently, so compare their previews.

4. Make HTML print cleanly with CSS

If you control the HTML, add print rules to hide controls, set paper size, and reduce awkward page breaks.

<!doctype html>
<html lang='en'>
<head>
  <meta charset='utf-8'>
  <title>Invoice 1042</title>
  <style>
    @page { size: A4; margin: 16mm; }
    body { font: 12pt/1.45 Arial, sans-serif; color: #111; }
    .avoid-break { break-inside: avoid; page-break-inside: avoid; }
    table { width: 100%; border-collapse: collapse; }
    th, td { border: 1px solid #bbb; padding: 6pt; }
    thead { display: table-header-group; }
    tr { break-inside: avoid; page-break-inside: avoid; }
    img { max-width: 100%; }
    @media print {
      nav, button, .chat-widget, .screen-only { display: none !important; }
      a { color: #111; text-decoration: none; }
    }
  </style>
</head>
<body>
  <nav class='screen-only'>Site navigation</nav>
  <main><h1>Invoice 1042</h1><section class='avoid-break'>...content...</section></main>
</body>
</html>
  • @page sets paper and margins, subject to the print dialog.
  • break-inside: avoid helps keep short cards, rows, and signatures together. Very tall content can still split.
  • thead { display: table-header-group; } allows table headings to repeat across pages in Chromium-based output.
  • Use absolute image URLs or embedded data when the file may be opened offline.

5. Windows 10 fallback: Microsoft Print to PDF

If Edge’s PDF destination is missing, open the system dialog with Ctrl+Shift+P, select Microsoft Print to PDF, select Print, then choose the filename and location. Microsoft Q&A describes this as a Windows fallback; labels can vary by installation. If the printer is absent, check Settings → Devices → Printers & scanners or ask an administrator to enable the feature.

6. Repeatable conversion from a script

For a local file, browser printing is usually simplest. For batch jobs or authenticated pages, use a capture API or browser automation. Keep credentials out of source control and verify that the response is a PDF before saving it.

PowerShell example

$url = 'https://example.com/report.html'
Start-Process 'msedge.exe' -ArgumentList $url
# In Edge, press Ctrl+P and save through Microsoft Print to PDF.

This opens a page for deliberate preview; it does not silently control the protected Windows print dialog.

7. Or skip the browser setup

ScreenshotNeo returns a PDF from one GET request. See the ScreenshotNeo API docs for output and PDF parameters.

cURL

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}`);

For PDF output, pass the PDF option documented by ScreenshotNeo. The service supports full-page capture with lazy images loaded, CSS element capture, dark mode, device presets, custom viewports, retina scale, PDF paper size, margins, landscape mode, page ranges, custom CSS and JavaScript, clicks, hidden selectors, selector or network-idle waits, blocked requests, custom headers, cookies, user agents, Authorization, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, asynchronous jobs with signed webhooks, bulk capture of up to 100 URLs per call, a usage API, and an OpenAPI specification.

Cookie banners, newsletter popups, and chat widgets are removed before capture, with each step independently switchable. Bot checks or CAPTCHAs, blank pages, timeouts, failed loads, and cache hits are not billed; responses identify the result with X-Page-Verdict and X-Billed. The MCP server provides take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients.

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

8. Troubleshooting checklist

Symptom Cause Fix
Preview is blank or failed Transient Edge state or missing PDF viewer Cancel, press Ctrl+P again, and restart Edge. Follow Microsoft’s print troubleshooting steps.
Colors or images disappear Background graphics disabled or resources blocked Enable Background graphics, reload, and check image URLs and print CSS.
Table is cut off Content is wider than paper Choose Landscape, reduce scale, use wider paper, or adjust the table for print.
Cards split awkwardly No break rules Add break-inside: avoid to short blocks; allow very tall blocks to split.
Fonts change Web font did not load Wait for loading, use fallback fonts, and reopen the PDF to verify.
Long-page content is missing Lazy loading or print CSS hiding content Scroll through once, wait for content, and inspect print rules.
Microsoft Print to PDF is missing Windows feature or policy disabled Use Edge’s PDF destination, ask an administrator to enable it, or use Firefox.
Links do not work Viewer or conversion stripped annotations Test another PDF viewer; use a controlled capture pipeline when links are required.

9. Performance, reliability, and cost

  • One-off conversion: browser printing is local and gives an immediate visual preview.
  • Repeated jobs: use waits for dynamic content, caching for unchanged pages, and asynchronous jobs for long runs.
  • Reliability: save to a known folder, use stable filenames, reopen files after creation, and record the source URL and page count.
  • API cost control: ScreenshotNeo bills only clean shots. Failed loads, bot checks, blank pages, timeouts, and cache hits cost nothing. Choose a cache TTL that matches how often the page changes.

10. FAQ

Can I convert an HTML file without uploading it?

Yes. Open it in Edge or Firefox and print to PDF; conversion happens on Windows 10.

Why does the PDF differ from the screen?

Print CSS, pagination, margins, scale, and disabled backgrounds change output. Use the preview and a print stylesheet.

Which browser should I use?

Edge has documented controls and a system-dialog fallback. Firefox has a Save to PDF destination. Choose the preview that preserves your layout.

Can I create PDFs for many URLs?

Use a scripted capture service or automation instead of clicking each dialog. ScreenshotNeo supports bulk capture and asynchronous jobs.