ExportFontFormat Enumeration |
Indicates the format that is used to export fonts while rendering to HTML fixed format.
Namespace:
Aspose.Words.Saving
Assembly:
Aspose.Words (in Aspose.Words.dll) Version: 20.3
Syntaxpublic enum ExportFontFormat
Public Enumeration ExportFontFormat
public enum class ExportFontFormat
Members
| Member name | Value | Description |
---|
| Woff | 0 |
WOFF (Web Open Font Format).
|
| Ttf | 1 |
TTF (TrueType Font format).
|
Remarks
ExamplesShows how used target machine fonts to display the document.
public void UsingMachineFonts()
{
Document doc = new Document(MyDir + "Bullet points with alternative font.docx");
HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions
{
UseTargetMachineFonts = true,
FontFormat = ExportFontFormat.Ttf,
ExportEmbeddedFonts = false,
ResourceSavingCallback = new ResourceSavingCallback()
};
doc.Save(ArtifactsDir + "HtmlFixedSaveOptions.UsingMachineFonts.html", saveOptions);
}
private class ResourceSavingCallback : IResourceSavingCallback
{
public void ResourceSaving(ResourceSavingArgs args)
{
Console.WriteLine($"Original document URI:\t{args.Document.OriginalFileName}");
Console.WriteLine($"Resource being saved:\t{args.ResourceFileName}");
Console.WriteLine($"Full uri after saving:\t{args.ResourceFileUri}");
args.ResourceStream = new MemoryStream();
args.KeepResourceStreamOpen = true;
string extension = Path.GetExtension(args.ResourceFileName);
switch (extension)
{
case ".ttf":
case ".woff":
{
Assert.Fail(
"'ResourceSavingCallback' is not fired for fonts when 'UseTargetMachineFonts' is true");
break;
}
}
}
}
See Also