HtmlSaveOptions.FontsFolderAlias

HtmlSaveOptions FontsFolderAlias property. Specifies the name of the folder used to construct font URIs written into an HTML document. Default is an empty string.

HtmlSaveOptions.FontsFolderAlias property

Specifies the name of the folder used to construct font URIs written into an HTML document. Default is an empty string.

public string FontsFolderAlias { get; set; }

Remarks

When you save a document in HTML format and ExportFontResources is set to true, Wordize needs to save fonts used in the document as standalone files. FontsFolder allows you to specify where the fonts will be saved and FontsFolderAlias allows to specify how the font URIs will be constructed.

If FontsFolderAlias is not an empty string, then the font URI written to HTML will be FontsFolderAlias + <font file name>.

If FontsFolderAlias is an empty string, then the font URI written to HTML will be FontsFolder + <font file name>.

If FontsFolderAlias is set to ‘.’ (dot), then the font file name will be written to HTML without path regardless of other options.

Alternative way to specify the name of the folder to construct font URIs is to use ResourceFolderAlias.

Examples

Shows how to configure exporting fonts to HTML.

HtmlSaveOptions htmlSaveOptions = new HtmlSaveOptions();
// Enable exporting font resources
htmlSaveOptions.ExportFontResources = true;
// Configure folder and it's alias where fonts will be written to.
htmlSaveOptions.FontsFolder = ArtifactsDir+"fonts";
htmlSaveOptions.FontsFolderAlias = "fonts";
// Disable font subsetting by setting subsetting size threshold to maximum value.
htmlSaveOptions.FontResourcesSubsettingSizeThreshold = int.MaxValue;

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

See Also