NPM Package/docs/components/measurement/extraction
Data Extraction
Read a snapshot of the current Canvas annotations and measurements using the SDK.
Use viewer.annotations.getData(...) to read a snapshot of the current Canvas annotations and measurements.
Data extraction is available after the viewer is mounted, Canvas is ready, and a document is open.
typescript
Overview
Fetch active annotation markups:
getData(...)sendsgetAnnotationDataand waits for the matching response payload with the same request ID.
typescript
Read All Annotation Data
Filter the extracted items using the filter property:
all: Extract all annotation and measurement markup.annotations: Non-measurement markups only.measurements: Measurement markups only.drawing: CAD drawing features (normalized to annotations).
typescript
Filters
The SDK structures results as follows:
typescript
Result Shape
Complete integration code setup for Vanilla HTML/JS environments:
Vanilla Example
Complete React Component implementation details:
tsx
React Integration
Broker message mapping for annotation data extraction:
viewer.annotations.getData(...)maps togetAnnotationDatarequest and response.
