# ServerSheetControl.setPrintContext Method

> ServerSheetControl.setPrintContext method in the TX Sheet Control TypeScript API for Node.js: Set shared header/footer field context.

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

---

Set shared header/footer field context.

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

### Syntax

```typescript
setPrintContext(context: PrintContext): void
```

### Parameters

| Parameter | Type | Optional | Description |
|---|---|---|---|
| `context` | `PrintContext` | No | Operation-specific input; see the owning type for units and scope. |

### Return Value

`void`.

### Examples

Pass an existing ServerSheetControl from the owning document. Related handles and input bytes must belong to the intended document and application; the function applies the operation and inspects its result.

```typescript
import type { ServerSheetControl } from '@txtextcontrol/tx-sheet-control-server';

function applyServerSheetControlSetPrintContext(
    sheetControl: ServerSheetControl,
    context: Parameters<ServerSheetControl['setPrintContext']>[0],
) {
    sheetControl['setPrintContext'](context);
}
```

### 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/typescript-api/nodejs/serversheetcontrol/llms-full.txt)
- [Exporting Worksheets to PDF](https://docs.textcontrol.com/tx-sheet-control/pdf/export/llms-full.txt)
- [PrintContext Type](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/printcontext/llms-full.txt)

---

## Nearby

- **Previous:** [ServerSheetControl.saveText Method](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/serversheetcontrol/savetext-method/llms-full.txt)
- **Next:** [ServerSheetControl.userName Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/nodejs/serversheetcontrol/username-property/llms-full.txt)
