# Javascript: Annotations.export Method

> Serializes the page-indexed annotation collection as JSON.

- **Product:** DS Server
- **Section:** Reference
- **Kind:** Method
- **Introduced:** 29.0
- **Path:** DS Server > Reference > JavaScript API - Document Viewer > Javascript: Annotations.export Method
- **176 words**
- **Web URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/annotations/export-method/
- **LLMs URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/annotations/export-method/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/annotations/export-method/llms-full.txt

---

### Description

Serializes the page-indexed annotation collection as JSON.

### Syntax

```javascript
<string> Annotations.export()
```

### Return Value

Serializes the page-indexed annotation collection as JSON.

### Examples

The following example demonstrates `annotations.export` in a practical Document Viewer workflow. Exports all annotations as a JSON string.

```javascript
const annotationJson = TXDocumentViewer.annotations.export();
const pages = JSON.parse(annotationJson);
console.log("Exported annotations from", pages.length, "pages.");
```

---

## Nearby

- **Previous:** [Annotations Class](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/annotations/llms-full.txt)
- **Next:** [Javascript: Annotations.getStampList Method](https://docs.textcontrol.com/ds-server/reference/javascript-document-viewer/annotations/getstamplist-method/llms-full.txt)
