TX Sheet Control

NativeLoadOptions.MaxFileBytes 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

Syntax

public long? MaxFileBytes { get; init; }

Property Value

long?.

Examples

Load an application-supplied workbook with these conversion settings, edit and format its heading, and return a PDF of the result.

using TXTextControl.TXSheetControl.Server;

async Task<byte[]> CreateConfiguredNativeLoadOptionsMaxFileBytesAsync(ServerSheetControl control, byte[] originalDocument)
{
    var settings = new NativeLoadOptions()
    {
        MaxFileBytes = 16777216
    };

    await control.LoadAsync(originalDocument, StreamType.InternalWorkbookFormat, new LoadOptions { InternalWorkbookFormat = settings });

    var sheet = await control.Workbook.Sheets.AtAsync(0);
    await sheet.Cell("A1").SetTextAsync("Reviewed invoice");
    await sheet.Cell("A1").FormatAsync(new { fontFamily = "Liberation Sans", fontSize = 16, bold = true, textColor = "#ffffff", fillColor = "#163b63" });
    return await control.SaveAsync(StreamType.PDF, new SaveOptions { OmitDashboards = true });
}

Remarks

Use the member with an instance or settings object from the documented package. Await task-returning operations. Document-bound handles must be resolved again after loading or deleting their owner.

See Also