TX Sheet Control

DocumentFontSource.Base64 Property

Property
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

Base64 TrueType-outline bytes, limited to 32 MiB per face.

Syntax

public required string Base64 { get; init; }

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);
}