HTML Conversion API for .NET

Convert HTML, XHTML, MHTML, EPUB, Markdown, and SVG to PDF, DOCX, XPS, and images in C#

Convert HTML and Web Formats in C#

Aspose.HTML for .NET is a C# library for converting HTML and related web formats in .NET applications. Use it to render HTML, XHTML, MHTML, EPUB, Markdown, or SVG to PDF, DOCX, XPS, and raster image formats without automating a browser.

For HTML conversion, the API accepts a file, URL, stream, string, or an in-memory HTMLDocument . The Converter class performs the conversion, while format-specific save options control the result.

The basic workflow has three steps:

  1. Load the source into an HTMLDocument, or pass a supported source directly to the converter.
  2. Create an output options object such as PdfSaveOptions, DocSaveOptions, XpsSaveOptions, or ImageSaveOptions.
  3. Call Converter.ConvertHTML() and specify the output file or stream.

Start with HTML to PDF , HTML to DOCX , HTML to image , or choose another source and output format below.

Try HTML Conversion and Review the C# Code

Use the interactive example below to convert an HTML file or URL and inspect the corresponding C# workflow. Select an output format to update the save options and conversion method used in the code. For a standalone no-code tool, use the free online HTML converter.

HTML Conversion Documentation and Examples

The Aspose.Html.Converters namespace provides methods for converting HTML, XHTML, MHTML, EPUB, Markdown, and SVG. Output-specific classes let you configure PDF page setup, DOCX output, XPS rendering, image formats, resolution, and other conversion settings.

See Converting Between Formats for detailed C# guides, input variants, save options, and output stream examples. For task-specific product information, use the conversion pages below, including HTML to PDF , MHTML to PDF , and Markdown to HTML .

Install Aspose.HTML for .NET

Add Aspose.HTML to a .NET project from NuGet:

dotnet add package Aspose.HTML

You can also install the package with the NuGet Package Manager UI or Package Manager Console. See the installation guide for setup instructions, or request a temporary license to evaluate the API without evaluation limitations.

Explore Supported .NET Conversions

Choose a source and output pair for focused C# examples, API links, save options, and an interactive conversion demo: