Drawing Class
- Namespace
TXTextControl.TXSheetControl. Server
- Package
TXTextControl.from the private NuGet feed or the supplied NuGet folderTXSheetControl. Server
- Assembly
TXTextControl.TXSheetControl. Api. dll
- Install
dotnet add package TXTextControl..NET 10 and later.TXSheetControl. Server
- Also in
TXTextControl.asTXSheetControl. Blazor TXTextControl.TXSheetControl. Api. dll
- Inherits
- Document
Object - Drawing
- Document
Worksheet-scoped server API contract; requests retain document identity and cancellation semantics.
Syntax
public class Drawing
Members
Properties
| Property | Description |
|---|---|
| Id |
Methods
| Method | Description |
|---|---|
| BringForwardAsync | Performs an operation on this document without activating another worksheet. |
| BringToFrontAsync | Performs an operation on this document without activating another worksheet. |
| CopyToAsync | Performs an operation on this document without activating another worksheet. |
| GetNameAsync | Performs an operation on this document without activating another worksheet. |
| GetSizeAsync | Performs an operation on this document without activating another worksheet. |
| GetSnapshotAsync | Performs an operation on this document without activating another worksheet. |
| MoveToAsync | Performs an operation on this document without activating another worksheet. |
| RemoveAsync | Performs an operation on this document without activating another worksheet. |
| RenameAsync | Performs an operation on this document without activating another worksheet. |
| ResizeAsync | Performs an operation on this document without activating another worksheet. |
| RotateAsync | Performs an operation on this document without activating another worksheet. |
| SendBackwardAsync | Performs an operation on this document without activating another worksheet. |
| SendToBackAsync | Performs an operation on this document without activating another worksheet. |
| UpdateAsync | Performs an operation on this document without activating another worksheet. |
Examples
Build a small report using this document API and return its PDF bytes. Pass a live control with a fresh workbook; the caller owns its lifetime.
using TXTextControl.TXSheetControl.Server;
async Task<byte[]> CreateDrawingReportAsync(ServerSheetControl control)
{
var book = control.Workbook;
var sheet = await book.Sheets.AtAsync(0);
var drawing = await sheet.Drawings.AddShapeAsync(new { type = "rectangle", name = "Invoice heading", text = "Invoice", anchor = new { cell = "F2" }, size = new { width = 240, height = 80 }, fill = "#e5eef4" });
await drawing.UpdateAsync(new { text = "Invoice approved", fill = "#e5eef4" });
return await control.SaveAsync(StreamType.PDF);
}
See Also
GetBarcodeAsync — Reads detached floating barcode settings, or null for an ordinary drawing.
UpdateBarcodeAsync — Replaces all barcode settings while retaining drawing identity and geometry. Ordinary drawings reject this operation.