# AnnotationsApi.flatten()

```ts
flatten(pageIndex?: number, options?: SignedDocumentOptions): Promise<void>
```

Burns annotations into page content as they show on screen (Acrobat's default), dropping hidden ones. Omit the index for the whole document. **Not reversible.** Flattening on export keeps the page as it prints instead: what is marked not to print is dropped. Flattening a signed document changes what the signature covers, so it would no longer verify: refused as Acrobat refuses. Needs the `annotations` feature, and `forms` too where a form field's widget is flattened.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `pageIndex?` | `number` | Zero-based page index. Omit for the whole document. |
| `options?` | `SignedDocumentOptions` | `{ invalidateSignatures? }`. |

Returns `Promise<void>`

Throws:

- `INVALID_ARGUMENT` — a page index out of range.
- `FEATURE_NOT_LICENSED` — the license lacks `annotations` (or `forms`, when a page to flatten carries form fields).
- `INVALID_STATE` — a signed document, unless `options.invalidateSignatures`; or a progressive document still downloading.
- `PAGE_ERROR` — a page could not be flattened.
- `DOCUMENT_CLOSED` — the document has been closed.

```ts
await doc.annotations.flatten(); // the whole document
```

Part of [AnnotationsApi](https://kernstra.com/docs/web-sdk/api/doc-annotations) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/doc-annotations/flatten
