# Javascript: Annotations.load Method

> Replaces the collection with annotations from viewer JSON.

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

---

### Description

Replaces the collection with annotations from viewer JSON.

### Syntax

```javascript
<void> Annotations.load(<string> json)
```

### Parameters

| Parameter | Description |
|---|---|
| json | JSON string containing the serialized annotations. |

### Return Value

Replaces the collection with annotations from viewer JSON.

### Examples

The following example demonstrates `annotations.load` in a practical Document Viewer workflow. Loads annotations from a JSON string.

```javascript
function restoreAnnotations(annotationJson) {
    JSON.parse(annotationJson);
    TXDocumentViewer.annotations.load(annotationJson);
    TXDocumentViewer.annotations.showSidebar(true);
}
```

---

## Nearby

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