HtmlSaveOptions.CssStyleSheetType

HtmlSaveOptions CssStyleSheetType property. Specifies how CSS Cascading Style Sheet styles are exported to HTML MHTML or EPUB. Default value is Inline for HTML/MHTML and External for EPUB.

HtmlSaveOptions.CssStyleSheetType property

Specifies how CSS (Cascading Style Sheet) styles are exported to HTML, MHTML or EPUB. Default value is Inline for HTML/MHTML and External for EPUB.

public HtmlCssStyleSheetType CssStyleSheetType { get; set; }

Remarks

Saving CSS style sheet into an external file is only supported when saving to HTML. When you are exporting to one of the container formats (EPUB or MHTML) and specifying External, CSS file will be encapsulated into the output package.

Examples

Shows how to specify a prefix which is added to all CSS class names.

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.CssClassNamePrefix = "mycss_";
htmlSaveOptions.CssStyleSheetType = HtmlCssStyleSheetType.External;
htmlSaveOptions.CssStyleSheetFileName = "my_styles.css";

Converter.Create()
    .From(MyDir + "Simple.docx")
    .To(ArtifactsDir + "HtmlSaveOptions.CssClassNamePrefix.html", htmlSaveOptions)
    .Execute();

See Also