ScreenshotNeo

BlogHTML to image & PDF

How to Save MHTML as PDF

Open an MHTML file in a compatible browser, print it, choose Save as PDF, and verify the result with this complete guide.

By the ScreenshotNeo team1 October 20267 min read

The dependable way to save an MHTML file as a PDF is to open the .mhtml or .mht archive in a browser, open the print dialog, select a PDF destination, review the preview, and save. The browser prints the page as it renders it. That means the PDF may not preserve every interactive behavior or match the archive pixel for pixel, so check the preview before sharing or automating the result.

Save an MHTML file as PDF in a browser

Chrome on Windows or Linux

  1. Open the .mhtml or .mht file in Chrome. You can double-click it, drag it into a Chrome window, or use Chrome’s Open File command.
  2. Press Ctrl+P.
  3. In the print preview, set Destination to Save as PDF.
  4. Review the preview and adjust page range, paper size, orientation, scale, and margins.
  5. Click Save, choose a filename and folder, then open the PDF to verify it.

Chrome on macOS

  1. Open the archive in Chrome.
  2. Press Command+P.
  3. Choose Save as PDF or another PDF destination in the system print dialog.
  4. Check the preview, page settings, and output location, then save.

Microsoft Edge

  1. Open the MHTML file in Edge.
  2. Press Ctrl+P on Windows or Command+P on macOS.
  3. Select an available PDF destination, such as Save to PDF or Microsoft Print to PDF.
  4. Review page range, paper size, orientation, scale, margins, headers, and footers before saving.

Edge also documents Immersive Reader as a way to simplify printing on supported websites. It may not be available for a local MHTML archive.

Firefox

  1. Open the archive in Firefox if your installed version renders it correctly.
  2. Open the menu and choose Print.
  3. In the destination list, choose Save to PDF.
  4. Review the preview and page settings, then save the file.

Firefox’s PDF destination is documented for displayed pages; support can vary between MHTML files because the archive may depend on browser-specific security and resource handling.

Chrome on Android

  1. Open the MHTML file in Chrome if Android can access and render it.
  2. Tap More, then Share, then Print.
  3. Select Save as PDF.
  4. Choose a location and save.

Choose print settings that preserve the document

Print settings control the PDF’s pagination and appearance. Start with the preview rather than assuming the browser will choose suitable values.

Setting What to check Typical adjustment
Page range All required sections are included Use all pages, or enter a specific range after inspecting the preview
Paper size Tables, screenshots, and wide layouts fit Try A4 or Letter; use landscape for wide content
Orientation Portrait pages are not clipping horizontal content Switch to landscape for wide tables or dashboards
Scale Text is readable and elements are not cut off Use the browser’s fit or scale control and recheck every page
Margins Content is not hidden at page edges Use default or minimum margins, then inspect headers and footers
Background graphics Colored sections or backgrounds are needed Enable background graphics when the print dialog provides it
Headers and footers URLs, dates, or titles should be present Enable them for audit context, disable them for a cleaner document

What the conversion preserves—and what it cannot

MHTML is a web-page archive. It packages a page and related resources so a browser can render a saved copy. PDF is a paginated print representation. During conversion, the browser creates a print rendering of the archive.

  • Text and images that render in the browser usually appear in the PDF.
  • Interactive controls, animations, video playback, hover states, and application state may not remain interactive.
  • Content loaded only after a script runs may be missing if the archive or browser cannot execute it.
  • Page breaks, fonts, margins, and scaling can differ from the screen view.
  • A local archive can render differently in Chrome, Edge, and Firefox because MHTML handling and security restrictions differ.

Always compare the saved PDF with the opened archive when accuracy matters. The official Chrome, Edge, and Firefox print instructions describe the print workflow, but they do not guarantee identical output for every MHTML variant.

Troubleshooting MHTML to PDF conversion

The file will not open

Cause: The archive may be malformed, associated with the wrong application, or blocked by browser security restrictions.

  • Confirm the extension is .mhtml or .mht.
  • Drag the file into a browser window instead of opening it from the file manager.
  • Try another Chromium-based browser, such as Edge.
  • Check that the file was copied completely and has a non-zero size.
  • If the archive came from an untrusted source, keep it offline while diagnosing it.

The browser shows a blank page

Cause: Resources may be unavailable, scripts may fail under local-file restrictions, or the archive may not contain a complete page.

  • Open the file in another supported browser.
  • Compare the archive with the original page, if it is still online.
  • Use the browser’s developer console to identify missing resources or script errors.
  • Ask for a new archive captured after the original page finished loading.

The PDF is missing sections

Cause: The print range, page scale, or layout may be clipping content, or the missing content may not be present in the rendered archive.

  • Set the page range to all pages.
  • Try a different paper size, orientation, scale, or margin setting.
  • Scroll through the entire archive before printing if it uses lazy-loaded content.
  • Check the preview page by page before saving.

Images look different or are missing

Cause: The image may be referenced externally, blocked by local-file policy, or dependent on a script that does not run during printing.

  • Wait for the archive to finish rendering before opening print preview.
  • Try Chrome and Edge, then compare the previews.
  • Verify that the image is visible in the browser before printing.
  • If the original page is online, print the original page instead of the local archive.

The output is too small or clipped

Change orientation, reduce margins, and adjust scale. Wide pages often need landscape orientation. Reopen print preview after each change because page breaks can move.

The PDF contains unexpected URLs, dates, or page numbers

These are browser header and footer settings. Disable headers and footers for a clean copy, or leave them enabled when provenance is useful.

When the original page is still online

If you can reach the original URL, printing that page directly is often simpler than converting a local archive. Open the page, wait for its required content to load, then use the browser’s print-to-PDF flow. This avoids problems caused by incomplete archives, missing external resources, or local-file restrictions.

Or skip the browser setup

For an online page, ScreenshotNeo can return a PDF from one API request. It is useful when you need repeatable captures in a script or build pipeline. The service removes cookie and consent banners, newsletter popups, and chat widgets before capture. Bot checks, blank pages, failed loads, timeouts, and cache hits are not billed, and the response identifies the result with X-Page-Verdict and X-Billed headers. Its MCP server lets Claude, Cursor, and other MCP clients use take_screenshot, get_page_info, and capture_pdf.

See the ScreenshotNeo API documentation for all options, including PDF paper size, margins, landscape mode, page ranges, custom headers and cookies, waiting rules, resource blocking, caching, asynchronous jobs, and bulk capture.

cURL

curl -G "https://api.screenshotneo.com/v1/shot" \
  -d access_key=YOUR_API_KEY \
  --data-urlencode url=https://example.com \
  -d format=pdf \
  -o page.pdf

Python

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={
        "access_key": "YOUR_API_KEY",
        "url": "https://example.com",
        "format": "pdf",
    },
    timeout=90,
)
r.raise_for_status()
open("page.pdf", "wb").write(r.content)

Node.js

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com',
  format: 'pdf'
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`ScreenshotNeo returned ${res.status}`);
const body = await res.arrayBuffer();
await Bun.write('page.pdf', body);

Replace https://example.com with the online page you want to archive. ScreenshotNeo captures a live URL; it does not accept an existing local MHTML file as the input. If the MHTML is your only copy, use the browser workflow above.

ScreenshotNeo includes every feature on every plan. The Free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots. Create a free ScreenshotNeo account.

Automation, reliability, and cost considerations

Automation

Browser printing is convenient for occasional files but requires a desktop session and manual preview. An API is easier to run from CI, a scheduled job, or a backend. Store the returned bytes as a PDF and record the URL, timestamp, selected options, and response verdict headers.

Reliability

  • For local archives, keep the original MHTML beside the PDF so the conversion can be repeated.
  • Verify that the PDF exists, has a plausible file size, and contains the expected page count.
  • For live pages, set an explicit timeout and waiting condition when the page needs time to render.
  • Retry transient network failures, but do not assume a retry fixes a bot check or a permanently missing page.

Cost

Browser print-to-PDF uses built-in software and has no per-file service charge. An API introduces usage limits and plan costs. ScreenshotNeo bills only clean shots; failed loads, bot checks, blank pages, timeouts, and cache hits cost nothing. Caching with a chosen TTL can reduce repeated captures.

FAQ

Is MHTML the same as PDF?

No. MHTML is an archive intended for browser rendering. PDF is a paginated document intended for viewing, printing, and sharing.

Can I convert MHTML without opening a browser?

The documented, dependable method is browser printing. For an online original page, an API such as ScreenshotNeo can create a PDF directly from the URL.

Why does my PDF not look exactly like the MHTML file?

Printing uses a print rendering with its own pagination, margins, fonts, and media rules. Interactive and dynamically loaded content can also change.

Should I use Chrome, Edge, or Firefox?

Start with the browser that created or reliably opens the archive. If it fails or renders blank, try another Chromium-based browser and compare the print previews.

Does Chrome’s MHTML save setting affect conversion?

No. The setting that controls creating MHTML with Save Page As is separate from opening an existing MHTML file and printing it to PDF.