# OfficeIMO.Html

Parse HTML, resolve resources safely, and render web content into OfficeIMO models. Add focused bridges only for MHTML, RTF, email, or PDF workflows.

Web document engine

Parse HTML, resolve resources safely, and render web content into OfficeIMO models. Add focused bridges only for MHTML, RTF, email, or PDF workflows.

MIT licensed No Office required Cross-platform .NET

[Start with the guide](/docs/html/) [Browse API](/api/html/) [View package](https://www.nuget.org/packages/OfficeIMO.Html)

Install `dotnet add package OfficeIMO.Html` 

[!\[OfficeIMO managed HTML renderer field guide generated as a PNG from the same scene as the interactive PDF and vector SVG\](/downloads/showcase/html/managed-renderer-gallery.png)](/downloads/showcase/html/managed-renderer-gallery.png) 

**Managed HTML renderer field guide**

The HTML, PDF, PNG, and SVG are emitted by one runnable example. The PDF retains searchable text, named page-margin content, vector gradients, MathML, and four AcroForm fields.

[Download interactive PDF](/downloads/showcase/html/managed-renderer-gallery.pdf) · [View source](/downloads/showcase/source/Converters/Html/HtmlManagedRendererGallery.cs.txt) · [Explore the example](/showcase/#managed-html-renderer-field-guide)

## Shared HTML behavior for every converter

Browse the [HTML examples](/showcase/?format=html) for source files, rendered previews, and downloads.

`OfficeIMO.Html` owns HTML parsing, resource policy, base-URI resolution, accessible structure and layout scenes. `OfficeIMO.Html.Pdf` renders those scenes to PDF and images. Word, Excel, PowerPoint, Markdown, and focused bridge packages reuse this owner instead of implementing separate web-content rules.

```csharp
// dotnet add package OfficeIMO.Html.Pdf
using OfficeIMO.Html;
using OfficeIMO.Html.Pdf;

HtmlConversionDocument source = HtmlConversionDocument.Parse(
    "<h1>Status</h1><p>Generated by OfficeIMO.</p>");
byte[] png = source.ToPng(new HtmlRenderOptions { ViewportWidth = 720 });
```

## Outputs and projections

- Render PDF, PNG, JPEG, TIFF, SVG, and lossless WebP with `OfficeIMO.Html.Pdf`.
- Convert semantic content to Word and Markdown through their focused adapter packages.
- Add `OfficeIMO.Html.Rtf` only for HTML/RTF conversion.
- Add `OfficeIMO.Mhtml` for bounded MHT/MHTML load and save, and `OfficeIMO.Mhtml.Pdf` for archive-to-PDF conversion.
- Add `OfficeIMO.Email.Image` only when an email body must be rendered to images.
- Apply URL, media, size, node, and depth policies before untrusted web content enters a document workflow.
- Require a no-loss render when a static template must stay inside the declared contract; otherwise every unsupported value remains visible through stable diagnostics.

The static renderer includes paged-media margin content, running elements, page counters, row and column subgrid, basic-shape clipping, vector SVG, tagged-PDF roles, and PDF bookmarks. JavaScript and live browser state remain an explicit browser-adapter concern rather than an automatic fallback.

Same engine, other surfaces

## Use OfficeIMO another way

[**Studio** Edit supported PDF text, comments, forms and pages in one desktop window. *Explore Studio →*](/studio/) [**Browser** Convert and organize files in your tab. Files never leave your device. *Open a tool →*](/convert/) [**CLI** The same conversions in scripts, CI jobs and AI agents over MCP. *Install the CLI →*](/cli/) [**AI agents** An MCP server, plugin and skills for Claude, Codex, Copilot and Cursor. *Add to your agent →*](/agents/) [**PowerShell** PSWriteOffice brings 540 commands to PowerShell 5.1 and 7. *Start with PowerShell →*](/powershell/)

Next step

## Turn the package into a working document.

Follow a focused guide and inspect the API reference for this package.

[Open the guide](/docs/html/)[Try HTML to PDF](/browser/html-to-pdf/)

<!-- PowerForge markdown artifact sha256:C8E315B05ADE8EDA7A4D4BDD03B478DD8A69C09EAA7E403B5261E4A996DD4F60 -->
