Style Features Supported on HTML Import

Style Type

Styles are imported from embedded or external CSS style sheets. Each selector is imported as a new Style in the Aspose.Words model. All styles are imported even if they are not actually used within the HTML body.

Style type is calculated based on the elements that the style is applied to. The appropriate style type is created from this.

The logic used when a external style sheet is enctounered on ocument load can be controlled using IResourceLoadingCallback. Using this callback you can choose to download the external style sheet, skip loading and avoid applying the styles from the sheet or specify your own style sheet to use instead.

See the following links in the documentation for further information:

Feature Supported Comment See Also
Paragraph Style Yes Imported from “class” attribute on HTML paragraph elements. - StyleType.Paragraph
Character Style Yes Imported from “class” attribute on span elements. - StyleType.Character
List Style Planned   - StyleType.List
Table Style Planned  

- Table.Style

- TableStyle

- StyleType.Table


Feature Supported Comment See Also
Aliases Yes Aliases are exported as ordinary CSS classes. On subsequent import they produce independent styles.  
Based On Planned   - Style.BaseStyleName
Built-in Styles Yes Some built-in styles are imported from specific elements.

For instance Normal redirects to general <p> element, <h1> to Heading 1 etc.

- Style.BuiltIn

- Style.StyleIdentifier

Custom Styles Yes A new style is created for all other CSS styles in the HTML document.  
Linked Styles Planned    
Style Name Yes   - Style.Name
Next Style N/A    
Paragraph Properties Yes   - Style.ParagraphFormat
Run Properties Yes   - Style.Font
Bullets and Numbering Yes  

- Style.List

- Style.ListFormat

Document Defaults

Feature Supported Comment See Also
Paragraph Properties N/A    
Run Properties N/A    

Table Style

Feature Supported Comment See Also
Apply Formatting to Planned   - Table.StyleOptions
Table Properties Planned   - TableStyle
Banding Planned   - Table.StyleOptions
Paragraph Properties Planned   - TableStyle.ParagraphFormat
Run Properties Planned   - TableStyle.Font