# ServerSheetControl.save Method

> ServerSheetControl.save method in the Node.js JavaScript API, with the return type Promise<Uint8Array<ArrayBufferLike>> and a JavaScript example.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Method
- **Path:** TX Sheet Control > API Reference > JavaScript API > Node.js Server > ServerSheetControl > ServerSheetControl.save Method
- **660 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/save-method/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/save-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/save-method/llms-full.txt

---

Saves an isolated revision as .xlsx, .txwb, PDF, CSV, tabular XML or tabular JSON without changing workbook metadata.

Owner: [ServerSheetControl](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/llms-full.txt). Package: `@txtextcontrol/tx-sheet-control-server`. Version: **2.0.0**.

### Syntax

```javascript
await owner.save(streamType, options)
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `streamType` | `StreamType` | No | Output format; PDF requires resolvable document fonts. |
| `options` | `SaveOptions \| undefined` | Yes | Reusable shared metadata, format settings and cancellation signal. |

### Return Value

`Promise<Uint8Array<ArrayBufferLike>>`.

Detached file bytes. The caller owns the returned array.

### Examples

Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.

```javascript
import { StreamType } from '@txtextcontrol/tx-sheet-control-server';
import { writeFile } from 'node:fs/promises';

async function exportInvoicePdf(control) {
    const book = control.workbook;
    const sheet = book.sheets.at(0);
    sheet.range('B8:B9').setValues([[120], [80]]);
    sheet.cell('B10').setFormula('=SUM(B8:B9)');

    const bytes = await control.save(StreamType.PDF, { pdf: { title: 'Invoice', locale: 'de-DE' } });
    await writeFile('invoice.pdf', bytes);
}
```

### Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

### See Also

- [ServerSheetControl Class](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/llms-full.txt)
- [Loading and Saving Workbooks](https://docs.textcontrol.com/tx-sheet-control/document-processing/load-save/llms-full.txt)
- [StreamType Enumeration](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/streamtype/llms-full.txt)
- [SaveOptions Interface](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/saveoptions/llms-full.txt)

---

## Nearby

- **Previous:** [ServerSheetControl.refreshFonts Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/refreshfonts-method/llms-full.txt)
- **Next:** [ServerSheetControl.saveText Method](https://docs.textcontrol.com/tx-sheet-control/reference/javascript-api/nodejs/serversheetcontrol/savetext-method/llms-full.txt)
