DS Server

Javascript: Annotations.export Method

Method|Introduced in 29.0

Description

Serializes the page-indexed annotation collection as JSON.

Syntax

<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.

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