ServerSheetControl Class
An isolated workbook, shared document API and file filters, without an editor or DOM.
Package: @txtextcontrol/tx-sheet-control-server. Version: 2.0.0.
ES module import: import { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';.
Constructor
new ServerSheetControl(options?: ServerSheetControlOptions): ServerSheetControl
| Parameter | Type | Optional | Description |
|---|---|---|---|
options | ServerSheetControlOptions | undefined | Yes | Supported settings for this operation; omitted settings retain documented defaults. |
Returns: ServerSheetControl.
Members
Properties
| Property | Description |
|---|---|
| licenseInfo | Immutable signed metadata; readable even after trial expiry or disposal. |
| options | The options value of ServerSheetControl. |
| userName | Current runtime comment author, shared with this control's workbook. |
| workbook | The workbook value of ServerSheetControl. |
Methods
| Method | Description |
|---|---|
| batch | Apply serializable compatibility commands atomically. |
| destroy | Dispose this isolated document. |
| getFontCatalog | Discovers the deployed families used by the editor and PDF export. Each call checks for file changes. |
| getFontFile | Reads a catalogued font for HTTP hosting without exposing trusted server paths. |
| getPdfInfo | Metadata for the last completed PDF export. |
| getPrintLayout | Read font-measured print geometry asynchronously. |
| getWarnings | Read merge/export warning strings. |
| getXlsxWarnings | Read retained XLSX feature notices. |
| invokeWorkbook | Invoke an allowlisted document operation by name. |
| load | Loads workbook bytes or CSV/XML/JSON text/bytes as an atomic document replacement. Native workbook JSON is not a tabular interchange format. |
| merge | Apply configured bindings to this document. |
| refreshFonts | Re-reads deployed fonts even if their filesystem timestamps were preserved. |
| save | Saves an isolated revision as .xlsx, .txwb, PDF, CSV, tabular XML or tabular JSON without changing workbook metadata. |
| saveText | Saves CSV, XML or JSON text with the same settings, snapshot, events and UTF-8 byte limits as save. A generated CSV BOM is omitted from the string; supplied settings are not modified. |
| setPrintContext | Set shared header/footer field context. |
Examples
Return a PDF byte array from an isolated server control. Configure a signed license before creating the server; Developer and OEM server exports have no licensing branding.
import { ServerSheetControl, StreamType } from '@txtextcontrol/tx-sheet-control-server';
async function createInvoicePdf() {
const control = new ServerSheetControl();
try {
const sheet = control.workbook.sheets.at(0);
sheet.range('B8:B9').setValues([[120], [80]]);
sheet.cell('B10').setFormula('=SUM(B8:B9)');
return await control.save(StreamType.PDF);
} finally {
control.destroy();
}
}