Aspose.Words Document Converter for .NET simplifies DOCX document to HTML conversion by preserving the source document’s structure. It also offers to preserve round-trip information along with customizable options to maintain the highest fidelity. You can also customize save options, organize resources, and embed fonts for portability.
Document
classDocument
class constructorDocument.Save
method, and pass HTML file pathGet the respective assembly files from the downloads or fetch the package from NuGet to add Aspose.Words
directly to your workspace.
Aspose.Words Document Converter for .NET provides the capability to export round-trip information when saving any document to HTML or MHTML formats. This feature ensures that the document’s original structure is preserved as closely as possible. Round-trip information, encompassing tabs, comments, headers, and footers, is preserved during HTML conversion by default. However, this feature is disabled for MHTML. You can enable it using the ExportRoundtripInformation
property of the HtmlSaveOptions
class.
Developers can designate a folder to save resources like images, fonts, and CSS during HTML conversion by using HtmlSaveOptions
class.
The HtmlSaveOptions.ResourceFolder
property simplifies this process, allowing customization for fonts and images. When using relative paths, FontsFolder
and ImagesFolder
refer to the code assembly’s folder, while ResourceFolder
and CssStyleSheetFileName
point to the HTML document’s output folder. Additionally, ResourceFolderAlias
aids in generating URLs for resources, offering a straightforward way to specify URI generation for resource files.
Aspose.Words allows you to specify whether font resources should be embedded into HTML in Base64 encoding. This is controlled by the ExportFontsAsBase64
property of HtmlSaveOptions
class, which extends the ExportFontResources
property. By default, this property is set to false
, resulting in fonts being written into separate files. However, setting it to true
embeds fonts into the document’s CSS in Base64 encoding.
Aspose.Words Document Converter for .NET is a tool built upon the Aspose.Words library for .NET. It allows you to programmatically convert documents between various formats such as DOCX, PDF, HTML, and more using .NET languages.
There are two main approaches to conversion - basic conversion involves using the Save
method with the desired filename extension (.html), while conversion with options entails using HtmlSaveOptions
to control aspects like encoding and including specific document elements.
Aspose.Words strives to maintain the original DOCX formatting in the HTML output. However, complex features like merge fields might require alternative output formats for optimal results.
The Aspose.Words Document Converter for .NET focuses solely on document conversion, offering a lower-priced option compared to the full Aspose.Words library, catering to users who primarily need conversion functionality.
Aspose.Words Document Converter for .NET enables you to convert documents into various file formats, including Word, PDF, HTML, OpenOffice, Markdown, JPG, PNG, and many others.
Some DOCX elements might have limitations when translating to HTML. Consider using alternative output formats offered by Aspose.Words, such as Fixed HTML, which prioritizes layout over exact content representation.
The Aspose.Words documentation provides a guide on the conversion process. Additionally, the Aspose.Words forum has discussions and troubleshooting tips from other users. You may also check the Aspose.Words GitHub account for related examples and demos.
The Aspose.Words Document Converter for .NET offers reliable support from experienced developers, utilizing the capabilities of the Aspose.Words library for seamless document conversion. It caters to diverse industries, facilitating convenient file format conversion for users across different workflows.
(Portable Document Format)
(Markdown Document)
(Office Open XML Macro-Enabled Document)
(Microsoft Word Markup Language)
(Mobipocket eBook)
(OpenDocument Text Document)
(MIME HTML (MHTML) Web Archive)
(Plain Text File)
(OpenDocument Text Template)
(EPUB eBook)
(Open XML Macro-Enabled Document Template)
(Word Document Template)
(Amazon Kindle Format 8)
(Rich Text Format)
(Microsoft Word Document)