NPM Package/docs/capabilities/styles/api
API Reference
Technical API reference for global and annotation-level styles using the SDK.
Use viewer.styles to set default appearance for new markup and to inspect or update properties for an existing annotation by GUID.
Style commands are available after the viewer is mounted, Canvas is ready, and a document is open.
typescript
Overview
Apply default fallback settings for all subsequent annotations drawn on the canvas:
typescript
Set Global Appearance
Inspect the style properties of a drawn markup:
typescript
Read Annotation Properties
Apply dynamic properties styling overrides directly to an annotation by GUID:
typescript
Update Annotation Properties
Supported configuration payloads and returned schemas:
typescript
Properties and Result Structures
SDK validates style configurations prior to Canvas transmission:
guidparameter is required for annotation-specific functions.timeoutMsmust be a valid number and defaults to 10000 if omitted.lineWidthmust be between 1 and 10.transparencymust be a percentage value from 0 to 100.- Colors must follow standard hex formats or
rgb(...)color configurations.
Complete integration code setup for Vanilla HTML/JS environments:
Vanilla Example
Broker message mappings for styling methods:
viewer.styles.setGlobalAppearance(...)maps tosetGlobalAppearance.viewer.styles.getAnnotationProperties(...)maps togetAnnotationProperties.viewer.styles.setAnnotationProperties(...)maps tosetAnnotationProperties.
