Skip to main content
OfficeIMO Docs Search documentation/

HTML and MHTML

Edit on GitHub

Parse, inspect, render, and safely project web content through the shared OfficeIMO.Html engine. Includes examples and API links.

Install

dotnet add package OfficeIMO.Html

Parse and render

using OfficeIMO.Html;

HtmlConversionDocument source = HtmlConversionDocument.Parse(
    "<h1>Status</h1><p>Generated by OfficeIMO.</p>");

byte[] png = source.ToPng(new HtmlRenderOptions {
    ViewportWidth = 720,
    Scale = 1.5
});

What the shared engine owns

  • HTML and MHTML parsing, DOM traversal, base URI handling, and archive resources.
  • URL and media policy, node/depth/size limits, and image discovery.
  • Accessible structure for headings, code, quotes, footnotes, and EPUB semantics.
  • Continuous and paged layout with PNG, JPEG, TIFF, SVG, and WebP output.
  • Bounded CSS math, caller stylesheets, deterministic media preferences, running page strings, and Unicode-range-aware WOFF 1/OpenType fonts.
  • Reusable semantic mappings for Markdown, Word, RTF, Email, and PDF adapters.
  • An executable capability catalog shared by the API, generated support matrix, and command-line tool.

Install only the adapter needed by the destination, such as OfficeIMO.Word.Html, OfficeIMO.Markdown.Html, or OfficeIMO.Html.Pdf. See the HTML API reference.

Install OfficeIMO.Tool when a shell or build pipeline needs bounded HTML/MHTML-to-PDF conversion without hosting .NET code.

Continue with rendering and conversion examples for image, PDF, Word, Markdown, and service-safe resource-policy patterns.