Aspose.HTML
22.9.0
See the version list below for details.
dotnet add package Aspose.HTML --version 22.9.0
NuGet\Install-Package Aspose.HTML -Version 22.9.0
<PackageReference Include="Aspose.HTML" Version="22.9.0" />
paket add Aspose.HTML --version 22.9.0
#r "nuget: Aspose.HTML, 22.9.0"
// Install Aspose.HTML as a Cake Addin #addin nuget:?package=Aspose.HTML&version=22.9.0 // Install Aspose.HTML as a Cake Tool #tool nuget:?package=Aspose.HTML&version=22.9.0
Convert HTML
to PDF
& HTML
to PNG
via .NET API
Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License
This .NET HTML API assists developers to write, read, modify, navigate and convert (X)HTML documents from within .NET applications.
Aspose.HTML for .NET API works as a headless browser that allows you to create or open existing HTML documents from various sources in order to perform manipulation operations such as remove and replace HTML nodes, save HTML documents, extract CSS from HTML, configure a document sandbox and more. You may navigate HTML documents by using various methods, such as, element traversal, document traversal, XPath queries, and CSS selector queries as well as manipulate HTML DOM via JavaScript, convert HTML file to images or fixed-layout formats, and convert (X)HTML and EPUB files to other file formats.
It helps you create, modify, extract, copy, delete and replace HTML document content, extract CSS from HTML, configure a document sandbox; load, read, and manage SVG files; render MHTML and EPUB documents to supported output file formats, and perform asynchronous operations.
This library supports parsing of HTML5, CSS3, SVG and HTML Canvas to construct a Document Object Model (DOM) based on the WHATWG DOM Standard. Insert, remove, and edit the nodes. You can navigate HTML documents by using various methods, such as element traversal, document traversal, XPath queries, and CSS selector queries as well as manipulate HTML DOM via JavaScript.
Aspose.HTML for .NET offers comprehensive format conversion support using which your applications can convert from HTML, SVG, EPUB, MHTML, and Markdown to various supported formats. You can also populate an HTML template from XML or JSON data sources. Aspose.HTML can easily work with large and complex HTML-documents.
The classes and properties of Aspose.HTML for .NET API have similar names as that of W3C HTML specification.
HTML Processing API Features
- Convert HTML to many popular formats including PDF, XPS and images.
- Load & convert SVG & EPUB to XPS, PDF and images.
- Navigate through document either by NodeIterator or TreeWalker.
- Control the timeout of the rendering process.
- MutationObserver to watch over DOM modifications.
- Populate HTML document with external data (XML & JSON).
- Support of single (PDF, XPS) or multiple (image formats) output file streams.
- Extract CSS styling information.
- Configuring Sandbox for the environment independent of the execution machine.
What's new in v22.9.0
Improved Ordered List Rendering in PNG
While converting HTML to PNG format, the ordered list is now being generated and rendered perfectly. The following is a simple HTML to PNG file converter C# code sample:
using System.IO;
using Aspose.Html;
using Aspose.Html.Converters;
using Aspose.Html.Rendering.Image;
using Aspose.Html.Saving;
...
// Prepare a path to a source HTML file
string documentPath = Path.Combine(DataDir, "nature.html");
// Prepare a path for converted file saving
string savePath = Path.Combine(OutputDir, "nature-output.png");
// Initialize an HTML document from the file
using var document = new HTMLDocument(documentPath);
// Initialize ImageSaveOptions
var options = new ImageSaveOptions(ImageFormat.Png);
// Convert HTML to PNG
Converter.ConvertHTML(document, options, savePath);
Fetch Fonts from Disk
During HTML to PDF Conversion, now our HTML processing API is able to get the fonts from the disk. This is a sample HTML to PDF converter C# code snippet:
using System.IO;
using Aspose.Html.Converters;
using Aspose.Html.Saving;
...
// Invoke the ConvertHTML method to convert the HTML code to PDF
Converter.ConvertHTML(@"<h1>Convert HTML to PDF!</h1>", ".", new PdfSaveOptions(), Path.Combine(OutputDir, "convert-with-single-line.pdf"));
Markdown (MD) Format Support
From this release the support to work with the Markdown MD format has been added. The following C# code snippet is a sample for standard MD to HTML conversion via API:
using System.IO;
using Aspose.Html.IO;
using Aspose.Html.Saving;
using Aspose.Html.Converters;
...
// Form source file path where `InputFolder` is the user source folder path
var sourcePath = Path.Combine(InputFolder, "simple.md");
// Form result file path
var resultPath = Path.Combine(OutputFolder, "result.html");
// Open source file as stream
using (var sourceStream = File.OpenRead(sourcePath))
{
// Initiate conversion process
var document = Converter.ConvertMarkdown(sourceStream, string.Empty);
// Save conversion result
document.Save(resultPath);
}
For a complete list of features, enhancements, and bug fixes in this release please visit, Aspose.HTML for .NET 22.9 Release Notes.
Read & Write Web Formats
Web: HTML, XHTML, MHTML
Other: SVG, MD (Markdown)
Save HTML As
Fixed Layout: PDF, XPS
Images: TIFF, JPEG, PNG, BMP, GIF
Read Formats
EPUB
Platform Independence
Aspose.HTML for .NET is written completely in C# and can be used to build any type of 32-bit or 64-bit .NET application including ASP.NET, WCF, WinForms & .NET Core. Development platforms include all flavors of Windows, Linux, and Mac OS X x64 (10.12+).
Getting Started
Are you ready to give Aspose.HTML for .NET a try? Simply execute Install-Package Aspose.Html
from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.HTML for .NET and want to upgrade the version, please execute Update-Package Aspose.Html
to get the latest version.
Convert HTML
to GIT-based Markdown (MD
) Format
// For complete examples and data files, please go to https://github.com/aspose-html/Aspose.HTML-for-.NET
// Prepare an HTML code and save it to the file.
var code = "<h1>Header 1</h1>" +
"<h2>Header 2</h2>" +
"<p>Hello World!!</p>";
System.IO.File.WriteAllText("document.html", code);
// Call ConvertHTML method to convert HTML to Markdown.
Aspose.Html.Converters.Converter.ConvertHTML("document.html", Aspose.Html.Saving.MarkdownSaveOptions.Git, "output.md");
Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net20 is compatible. net35 is compatible. net35-client is compatible. net40 is compatible. net40-client is compatible. net403 was computed. net45 was computed. net451 was computed. net452 was computed. net46 was computed. net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETFramework 2.0
- No dependencies.
-
.NETFramework 3.5
- No dependencies.
-
.NETFramework 3.5 Client
- No dependencies.
-
.NETFramework 4.0
- No dependencies.
-
.NETFramework 4.0 Client
- No dependencies.
-
.NETStandard 2.0
- System.Drawing.Common (>= 4.5.0)
- System.Security.Permissions (>= 4.5.0)
- System.Text.Encoding.CodePages (>= 4.5.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Aspose.HTML:
Package | Downloads |
---|---|
Aspose.Total
Aspose.Total for .NET is the most complete package of all .NET file format APIs offered by Aspose. It empowers developers to create, edit, render, print and convert between a wide range of popular document formats within any .NET, C#, ASP.NET and VB.NET applications. |
|
CHOCore.Tools
Package Description |
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
24.10.0 | 4,360 | 10/31/2024 |
24.9.0 | 10,263 | 9/25/2024 |
24.8.0 | 15,816 | 8/29/2024 |
24.7.0 | 9,896 | 7/31/2024 |
24.6.0 | 18,726 | 6/21/2024 |
24.5.0 | 24,247 | 5/3/2024 |
24.4.0 | 5,441 | 4/12/2024 |
24.3.0 | 32,886 | 3/18/2024 |
24.2.0 | 9,203 | 2/27/2024 |
24.1.0 | 81,859 | 1/11/2024 |
23.12.0 | 19,618 | 12/5/2023 |
23.11.0 | 40,262 | 11/3/2023 |
23.10.0 | 64,503 | 10/6/2023 |
23.9.0 | 49,282 | 9/5/2023 |
23.8.1 | 147,716 | 8/11/2023 |
23.7.0 | 23,996 | 7/12/2023 |
23.6.0 | 23,790 | 6/29/2023 |
23.5.0 | 39,924 | 5/3/2023 |
23.4.0 | 27,383 | 4/4/2023 |
23.3.0 | 79,572 | 3/10/2023 |
23.2.0 | 62,195 | 2/1/2023 |
23.1.0 | 52,373 | 1/20/2023 |
22.11.0 | 150,852 | 11/22/2022 |
22.10.0 | 42,380 | 10/28/2022 |
22.9.0 | 26,924 | 10/1/2022 |
22.8.0 | 75,473 | 8/19/2022 |
22.7.0 | 18,842 | 7/30/2022 |
22.6.0 | 22,181 | 6/28/2022 |
22.5.0 | 65,600 | 5/19/2022 |
22.4.0 | 29,333 | 4/19/2022 |
22.3.0 | 139,803 | 3/7/2022 |
22.2.0 | 34,079 | 2/11/2022 |
22.1.0 | 28,870 | 1/13/2022 |
21.12.0 | 19,432 | 12/8/2021 |
21.11.0 | 34,328 | 11/1/2021 |
21.10.0 | 12,958 | 10/9/2021 |
21.9.0 | 35,747 | 9/2/2021 |
21.8.0 | 54,763 | 8/4/2021 |
21.7.0 | 51,334 | 7/1/2021 |
21.6.0 | 11,405 | 6/9/2021 |
21.5.0 | 14,878 | 5/20/2021 |
21.4.0 | 22,163 | 5/1/2021 |
21.3.0 | 30,645 | 3/10/2021 |
21.2.0 | 77,799 | 2/4/2021 |
21.1.0 | 351,151 | 1/14/2021 |
20.12.0 | 27,483 | 12/4/2020 |
20.11.0 | 38,400 | 11/3/2020 |
20.9.0 | 24,507 | 9/30/2020 |
20.8.0 | 23,166 | 8/31/2020 |
20.7.0 | 10,278 | 7/28/2020 |
20.6.0 | 9,974 | 6/30/2020 |
20.5.0 | 40,982 | 5/20/2020 |
20.4.0 | 38,427 | 4/3/2020 |
20.3.0 | 98,513 | 3/12/2020 |
20.2.0 | 13,755 | 2/9/2020 |
20.1.0 | 7,440 | 1/14/2020 |
19.12.0 | 16,988 | 12/4/2019 |
19.11.0 | 13,386 | 11/11/2019 |
19.10.0 | 18,772 | 10/8/2019 |
19.9.0 | 18,180 | 9/6/2019 |
19.8.0 | 8,328 | 8/7/2019 |
19.7.0 | 9,002 | 7/8/2019 |
19.6.0 | 5,824 | 6/10/2019 |
19.5.0 | 16,694 | 5/9/2019 |
19.4.0 | 11,375 | 4/5/2019 |
19.3.0 | 34,781 | 3/5/2019 |
19.2.0 | 5,875 | 2/6/2019 |
19.1.0 | 3,591 | 1/9/2019 |
18.12.0 | 10,676 | 12/7/2018 |
18.11.0 | 11,939 | 11/6/2018 |
18.10.0 | 3,021 | 10/5/2018 |
18.9.0 | 13,031 | 9/5/2018 |
18.8.0 | 3,200 | 8/7/2018 |
18.7.0 | 2,999 | 7/5/2018 |
18.6.0 | 2,977 | 6/6/2018 |
18.5.0 | 5,524 | 5/2/2018 |
18.4.0 | 2,953 | 4/6/2018 |
18.3.0 | 13,526 | 3/6/2018 |
18.2.0 | 4,575 | 2/7/2018 |
18.1.0 | 14,673 | 1/11/2018 |
17.12.0 | 2,427 | 12/4/2017 |
17.11.0 | 2,294 | 11/9/2017 |
17.10.0 | 2,182 | 10/9/2017 |
17.9.0 | 2,375 | 9/8/2017 |
17.8.0 | 2,306 | 8/10/2017 |
17.7.0 | 9,173 | 7/14/2017 |