This gist repository contains C# code examples used in the Converting Between Formats chapter of the Aspose.HTML for .NET documentation. These examples demonstrate how to perform file format conversions using the Converter class. You will find examples for various common scenarios for HTML, XHTML, MHTML, SVG, EPUB, and Markdown conversion.
- Convert HTML, SVG, EPUB, MHTML, and Markdown files to other formats such as PDF, DOCX, image formats, and more.
- Customize conversion behavior with specific options like page sizing, output format settings, and resource handling.
- Work with the unified Converter API to perform conversions consistently and reliably.
This repository provides examples for converting:
- HTML Converter – Shows how to convert an HTML document to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, GIF, MD, and MHTML formats.
- SVG Converter – Provides information on how to convert SVG to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF formats.
- EPUB Converter – Demonstrates how to convert EPUB to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF formats.
- MHTML Converter – Describes how to convert MHTML to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF formats.
- Markdown Converter – Provides information on how to convert MD to HTML, PDF, XPS, DOCX, and various Image file formats.
- Fine-Tuning Converters – Alternative ways to render HTML and HTML-based documents that can give you more control over the rendering process in your C# application.
- Install the latest version of Aspose.HTML for .NET using NuGet.
- Browse the available gists and copy the code samples you need.
- Configure paths, settings, and inputs to suit your environment.
- Run your project to see the example in action.
You can download a free trial of Aspose.HTML for .NET and use a temporary license for unrestricted access.
Comprehensive explanations and full context for each example are available in the Converting Between Formats chapter of the official documentation.
Aspose.HTML for .NET is a powerful .NET library for parsing, modifying, and converting HTML and HTML-related formats (SVG, MHTML, XHTML, Markdown, EPUB). It provides built-in support for CSS, JavaScript, DOM traversal, XPath, document save options, and more.
If you have questions or suggestions related to these examples, please use the Aspose.HTML Support Forum to get help or share feedback.
- Documentation – Aspose.HTML for .NET
- Product page – Aspose.HTML for .NET
- Blog – Aspose.HTML Product Family
- API Reference – Aspose.HTML for .NET
- Free Online Converters – Aspose.HTML
To run the examples, you need:
- .NET Platforms: .NET 5.0, .NET Core, or .NET Framework installed on your machine.
- Supported OS: Windows, Linux, macOS.
- The Aspose.HTML for .NET library (you can install it via NuGet:
Install-Package Aspose.Html).