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.
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
- Start the installed Word application.
- Select File → Open.
- Choose the HTML file; select All files if it is hidden.
- 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
- Select File → Save As or Save a Copy.
- Choose PDF in the file-type list.
- Set a filename and location, then select Save.
- 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
- Open the supported document.
- Select File → Print.
- Word creates a PDF preview that keeps layout and formatting.
- 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.


