Availability
- Aspose.Words for .NET - Yes
- Aspose.Words for Java - Yes
HTML in Aspose.Words
HTML features in Aspose.Words:
- Load HTML and XHTML documents (well formed and not well formed).
- Load and save inline CSS styles.
- Save any document as HTML 4.0 or XHTML 1.0 Transitional.
- Save any document in MHTML (ready for email) format.
- Specify conversion options when saving.
Aspose.Words HTML and XHTML import is resilient to documents that are not well formed or are invalid. Invalid or unrecognized elements or attributes are safely ignored during import.
Conversion to HTML and XHTML in Aspose.Words is customizable. Many parameters like export of document properties, headers and footers, images location, scaling and resolution, form fields export options and others can be specified.
Although Aspose.Words provides extensive support for HTML elements and attributes, the fidelity of conversion to/from HTML in Aspose.Words is not as high as between Microsoft Word document formats. The reason is that some features of Microsoft Word documents do not map well to HTML (for example there are no tab characters in HTML).
Currently, Aspose.Words supports inline CSS styles only; that is CSS formatting defined in the "style" attribute on HTML elements. CSS styles defined in stylesheets (internal or external) will be supported in the future.
An MHTML document generated by Aspose.Words and emailed using Aspose.Network.
An HTML document generated by Aspose.Words and opened in Notepad.
Aspose.Words converted a DOC file (shown in Microsoft Word, first image) to HTML (shown in Internet Explorer, second image).