Interface: AnnotationPreset

PSPDFKit.AnnotationPreset

Describes and persists the properties of an annotation preset.

Annotation presets are sets of pairs property-value 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.

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);