Fine-Tuning Converters – Convert HTML in C#
A Few Ways to Convert HTML in C#
You can convert HTML to various popular formats in any way – online or programmatically. Converting from HTML to other formats can perform by using the ConvertHTML() methods of the Converter class, the RenderTo() method of the HTMLDocument class, or the Render() method of the Renderer class.
Why Use Fine-Tuning Converters?
In Fine-Tuning Converters chapter, Aspose.HTML for .NET provides alternative ways to render HTML documents that can give you more control over the rendering process in your C# application. Our C# library implements a set of rendering devices – PdfDevice, XpsDevice, DocDevice, and ImageDevice. Each has its unique set of options implemented with classes PdfRenderingOptions, XpsRenderingOptions, DocRenderingOptions, and ImageRenderingOptions, respectively. For example, you can change the page size, configure margins and colors, reduce the file size by adjusting image quality and resolution, set a security password in case of a PDF device, etc.
The current section describes supported scenarios of HTML-based files conversions to other popular formats by using the RenderTo() method of the HTMLDocument class and the Render() method of the Renderer class:
- Rendering Device – This article will teach you about render devices – PdfDevice, XpsDevice, DocDevice, and ImageDevice. The RenderTo() and Render() methods take the instances of the rendering devices as a parameter to render HTML to PDF, XPS, DOCX, and images.
- Rendering Options – With rendering options, you can set various conversion options such as page size, margins, image quality, orientation, background color, and more. These options are passed to rendering devices as parameters and help you turn the rendering process to get the desired output document.
- Renderers – In this article you will learn about supported renderers – HtmlRenderer, SvgRenderer, MhtmlRenderer, and EpubRenderer, which are used to render HTML, SVG, MHTML, and EPUB documents, respectively.
Aspose.HTML offers free HTML Web Applications that are an online collection of converters, mergers, SEO tools, HTML code generators, URL tools, and more. The applications work on any operating system with a web browser and do not require any additional software installation. It’s a fast and easy way to efficiently and effectively solve your HTML-related tasks.