Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Aspose.HTML for .NET is a headless C# library for creating, loading, editing, navigating, saving, and converting HTML-related documents. It works with HTML, XHTML, SVG, EPUB, MHTML, and Markdown source documents and can render or save them to supported output formats such as PDF, XPS, DOCX, Markdown, JPG, PNG, TIFF, BMP, and GIF.
The API is designed around web platform concepts such as DOM, CSS, SVG, JavaScript, Canvas, resource loading, and rendering. This page summarizes the main Aspose.HTML for .NET features and links to the documentation sections where you can explore them in detail.
Aspose.HTML for .NET lets you create, load, inspect, edit, and save HTML-family documents without opening a browser UI.
Aspose.HTML for .NET is not positioned as a web scraper by itself, but it can be used to collect information from loaded HTML documents and navigate their DOM structure.
One of the main goals of Aspose.HTML for .NET is to provide simple, customizable, and precise converters for HTML-related source formats.
Simplicity. The .NET API can convert HTML, XHTML, SVG, EPUB, MHTML, and Markdown to supported formats with compact C# code. The following example converts HTML to PDF:
1// Convert HTML to PDF using C#
2
3Aspose.Html.Converters.Converter.ConvertHTML(@"<span>Hello, World!!</span>", ".", new Aspose.Html.Saving.PdfSaveOptions(), "output.pdf");Customizability. Aspose.HTML for .NET lets you fine-tune converters and control many aspects of rendering and conversion. In addition to page size or image resolution, you can customize external resource processing, configure a custom stylesheet, set fonts, adjust page setup, and control output options.
Precision. Core components are designed according to official HTML, DOM, CSS, and SVG specifications, which helps produce predictable parsing, rendering, and conversion results.
Aspose.HTML for .NET converters can be grouped by workflow:
Explore the full conversion workflow map in Converting Between Formats.
A real-world HTML page is a complex set of related formats and technologies. Aspose.HTML for .NET includes implementations for core HTML-related technologies used during parsing, manipulation, and rendering.
| Feature area | What Aspose.HTML for .NET supports |
|---|---|
| HTML parsing | Parser behavior follows the HTML specification, helping produce a correct DOM tree for loaded documents. |
| JavaScript processing | JavaScript processing supports the ECMA-262 5.1 specification for scripts processed during document parsing or runtime. You can set a JavaScript processing timeout or disable script execution. |
| CSS | CSS3 is supported out of the box. Aspose.HTML for .NET includes CSS manipulation APIs and lets you apply stylesheets to the whole document or edit styles for a particular node. |
| HTML Canvas | HTML Canvas is supported. You can draw on it with JavaScript or use the HTML Canvas API. |
| SVG | SVG parsing and rendering are based on the SVG 2 specification, including support for modern SVG elements such as filters. |
You can use Aspose.HTML for .NET in 32-bit and 64-bit .NET applications, including web, desktop, service, and command-line projects. The package provides a .NET Standard 2.0 assembly and can be used on supported Windows, Linux, and macOS environments where the target .NET runtime and required native dependencies are available.
For the detailed compatibility matrix, see System Requirements.
Aspose.HTML for .NET also includes helper APIs and extensions for common HTML-related tasks.
| Issue | Cause | Fix |
|---|---|---|
| Expecting Aspose.HTML to behave like an interactive browser | Aspose.HTML for .NET is a headless library for document processing, DOM manipulation, and rendering workflows, not a browser UI automation tool. | Use it for loading, editing, extracting, saving, and converting HTML-related documents. For browser UI testing, use a browser automation framework. |
| Choosing the wrong API for data extraction | DOM navigation, XPath, and CSS selectors solve different querying problems. | Use DOM navigation for tree traversal, XPath for structured document queries, and CSS selectors for element matching by selector syntax. |
| Conversion output differs between environments | Rendering can depend on fonts, external resources, JavaScript settings, CSS, and runtime dependencies. | Configure fonts, resource loading, runtime services, and save options explicitly. For Linux image rendering issues, see Linux Docker Fonts for HTML to Image. |
| Assuming every supported output is editable | PDF, XPS, and raster images are rendering targets and are not ideal for semantic editing. | Use HTML-family output or DOCX when the next workflow requires editing document content. |
| Using outdated framework assumptions | Legacy framework support depends on current package and Microsoft runtime support. | Check System Requirements before choosing a target framework for a new project. |
Aspose.HTML for .NET can create, load, edit, navigate, save, extract data from, and convert HTML-related documents in C# applications.
It is not a dedicated web scraper, but it can load HTML documents and extract data with DOM navigation, XPath queries, and CSS selectors.
Aspose.HTML for .NET supports conversion workflows for HTML, XHTML, SVG, MHTML, EPUB, and Markdown sources to supported output formats such as PDF, XPS, DOCX, Markdown, and images. See Supported File Formats for the full table.
Yes. You can configure save options, page setup, image resolution, fonts, stylesheets, external resource handling, and JavaScript runtime behavior depending on the workflow.
Start with Installation, then review Supported File Formats and Converting Between Formats.
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.