TX Sheet Control

DocumentFontOptions Constructor

Constructor
Namespace
TXTextControl.TXSheetControl.Server
Package
TXTextControl.TXSheetControl.Server as TXTextControl.TXSheetControl.Api.dll from the private NuGet feed or the supplied NuGet folder
Also in
TXTextControl.TXSheetControl.Blazor as TXTextControl.TXSheetControl.Api.dll

Create settings before calling the central load/save methods.

Example

using TXTextControl.TXSheetControl.Server;

static async Task ConfigureInvoiceFontsAsync(ServerSheetControl control, byte[] workbookBytes, string fontPath)
{
    var options = new LoadOptions
    {
        Fonts = new DocumentFontOptions
        {
            Sources = [new DocumentFontSource
            {
                Family = "Invoice Sans",
                Base64 = Convert.ToBase64String(await File.ReadAllBytesAsync(fontPath))
            }]
        }
    };
    await control.LoadAsync(workbookBytes, StreamType.OpenDocumentSpreadsheet, options);
}