ScreenshotNeo

BlogHTML to image & PDF

How to Convert Microsoft Word HTML to PDF

Convert standalone HTML with desktop Word, save Word for the web documents as PDF, and avoid layout surprises with a practical checklist.

By the ScreenshotNeo team1 October 20264 min read

Short answer: For a standalone .html file, use desktop Word: open it, then choose File → Save As (or Save a Copy) and select PDF. If the document is already open in Word for the web, choose File → Print and save the PDF preview. Word for the web cannot open standalone HTML or MHTML files.

Choose the correct route

Starting point Workflow Limit
Standalone .html/.htm Desktop Word → Open → Save As PDF Inspect layout; arbitrary CSS is not guaranteed to match a browser
Document in Word for the web File → Print → Save to PDF Does not import an HTML file
Browser-faithful automation Browser renderer or capture API Requires a rendering service or runtime

Convert a standalone HTML file with desktop Word

1. Prepare the file

Keep local images and stylesheets beside the HTML file, use correct relative paths, and verify the page in a browser. Try this file:

<!doctype html>
<html lang="en"><head><meta charset="utf-8"><title>Invoice</title>
<style>body{font-family:Arial,sans-serif}.total{font-weight:bold;text-align:right}</style>
</head><body><h1>Invoice 1042</h1><p>Prepared for Example Ltd.</p><p class="total">Total: $125.00</p></body></html>

2. Open it in Word desktop

  1. Start the installed Word application.
  2. Select File → Open.
  3. Choose the HTML file; select All files if it is hidden.
  4. Accept any format warning and let Word import the markup.

Microsoft documents this open-in-Word pattern for an Outlook message saved as HTML. That supports the desktop route, but does not promise pixel-perfect rendering for every HTML page or CSS feature.

3. Export to PDF

  1. Select File → Save As or Save a Copy.
  2. Choose PDF in the file-type list.
  3. Set a filename and location, then select Save.
  4. Open the PDF and inspect every page.

Desktop Office versions expose PDF save/export options; labels and controls vary by platform and version.

Convert a document already open in Word for the web

  1. Open the supported document.
  2. Select File → Print.
  3. Word creates a PDF preview that keeps layout and formatting.
  4. Choose Save to PDF in the browser print dialog.

Microsoft lists HTML and MHTML as formats the browser app cannot open, so this workflow starts with a document Word for the web already supports.

What may change

Content Check in the PDF
Tables Widths, wrapping, borders and split rows
Images Missing assets, resolution and cropping
Fonts Substitution, line breaks and page count
Advanced CSS/scripts Ignored or flattened behavior; PDFs are static
External resources Authentication, network access and blocked requests

The cited Microsoft guidance does not guarantee identical browser and Word rendering. Inspect the result whenever layout matters.

Preflight checklist

  • Confirm images, fonts and styles load in a browser.
  • Use UTF-8 and valid asset paths.
  • Replace interactive controls with static content when needed.
  • Check page size, margins, orientation, headers, footers and page breaks.
  • Review long tables, links, bookmarks and metadata.
  • Compare source and PDF at 100% zoom.

Troubleshooting

Problem Cause Fix
Word for the web rejects HTML HTML/MHTML are unsupported Use desktop Word or an HTML renderer
HTML missing from Open Picker filters Word formats Select All files
Images blank Broken paths or blocked resources Test URLs and keep local assets beside the file
Fonts or breaks changed Unavailable fonts or CSS differences Use installed fonts, simplify CSS, recheck pagination
Wide table clipped Content exceeds printable width Reduce widths, change orientation or split it
Scripts vanished PDF is static Render the desired state into static HTML first
Unexpected page count Font substitution or automatic breaks Lock dimensions and add deliberate breaks

Performance, reliability and cost

  • Performance: Local, small files import faster; remote assets and large tables add work.
  • Reliability: Results depend on Word version, installed fonts and reachable assets. Keep source HTML with the PDF.
  • Repeatability: Standardize fonts, page setup and asset paths, then inspect representative outputs.
  • Cost: Standalone HTML needs desktop Word. Word for the web’s print route applies only to supported documents.

Or skip the browser setup

For hosted HTML that needs rendered output without maintaining a browser, ScreenshotNeo is a website screenshot API and MCP server. One GET request can return PNG, JPEG, WebP or PDF. Full-page capture, lazy-image loading, custom CSS/JavaScript, waits, headers, cookies, user agent, timezone, geolocation and PDF settings are available; see the documentation.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://example.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://example.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);

Choose PDF output and paper options as described in the API docs. Cookie banners, newsletter popups and chat widgets are removed before capture. Bot checks, blank pages and failed loads are never billed, and response headers identify the page verdict and billing status. The MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000. Create a free account.

FAQ

Can Word open HTML?

Desktop Word can open HTML in the documented Outlook workflow. Word for the web cannot open standalone HTML.

Can Word Online convert HTML to PDF?

Not by uploading HTML. It can print a supported document to a PDF preview.

Will the PDF match Chrome exactly?

Not necessarily; inspect fonts, images, tables and page breaks.

When should I use a renderer?

Use one when browser fidelity and repeatable automation matter more than an editable Word workflow.

Sources