HtmlSaveOptions.FontsFolder

HtmlSaveOptions FontsFolder property. Specifies the physical folder where fonts are saved when exporting a document to HTML. Default is an empty string.

HtmlSaveOptions.FontsFolder property

Specifies the physical folder where fonts are saved when exporting a document to HTML. Default is an empty string.

public string FontsFolder { 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 you save a document into a file and provide a file name, Wordize, by default, saves the fonts in the same folder where the document file is saved. Use FontsFolder to override this behavior.

If you save a document into a stream, Wordize does not have a folder where to save the fonts, but still needs to save the fonts somewhere. In this case, you need to specify an accessible folder in the FontsFolder property.

If the folder specified by FontsFolder doesn’t exist, it will be created automatically.

ResourceFolder is another way to specify a folder where fonts should be saved.

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