HtmlSaveOptions.ExportFontResources
HtmlSaveOptions ExportFontResources property. Specifies whether font resources should be exported to HTML MHTML or EPUB. Default is false.
HtmlSaveOptions.ExportFontResources property
Specifies whether font resources should be exported to HTML, MHTML or EPUB. Default is false
.
public bool ExportFontResources { get; set; }
Remarks
Exporting font resources allows for consistent document rendering independent of the fonts available in a given user’s environment.
If ExportFontResources
is set to true
, main HTML document will refer to every font via the CSS 3 @font-face at-rule and fonts will be output as separate files. When exporting to IDPF EPUB or MHTML formats, fonts will be embedded into the corresponding package along with other subsidiary files.
If ExportFontsAsBase64
is set to true
, fonts will not be saved to separate files. Instead, they will be embedded into @font-face at-rules in Base64 encoding.
Examples
Shows how to enable exporting font resource to HTML.
HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
htmlSaveOptions.ExportFontResources = true;
htmlSaveOptions.ExportFontsAsBase64 = true;
Converter.Create()
.From(MyDir + "Simple.docx")
.To(ArtifactsDir + "HtmlSaveOptions.ExportFontResources.html", htmlSaveOptions)
.Execute();
See Also
- class HtmlSaveOptions
- namespace Wordize.Saving
- assembly Wordize