Nutrient Web SDK

ReferenceAnnotationPreset

Type Alias AnnotationPreset

Describes and persists the properties of an annotation preset.

Annotation presets are sets of property-value pairs for annotations that can be applied as default annotations settings for toolbar items. When an annotation toolbar setting is changed by the user, the annotation preset associated with the toolbar item that triggered the annotation toolbar is updated. If the associated annotation preset doesn't exist, it's created with the settings that have changed.

For properties not included in an annotation preset, the default values used when creating an annotation are those of the annotation type.

Type Alias
Type Signature
type AnnotationPreset = Record<string, unknown>

Example

Creating an annotation preset and adding it to the available annotation presets.

const myAnnotationPresets = instance.annotationPresets
myAnnotationPresets['my-annotation-preset'] = {
strokeWidth: 2,
}
instance.setAnnotationPresets(myAnnotationPresets);

See Also