Nutrient Web SDK

ReferenceOnWidgetAnnotationCreationStartCallback

Type Alias OnWidgetAnnotationCreationStartCallback

You can programmatically modify the properties of the widget annotation and the associated form field just before it is created via the form creator UI.

Type Alias
Type Signature
type OnWidgetAnnotationCreationStartCallback = (
    annotation: NutrientViewer.Annotations.WidgetAnnotation,
    formField: NutrientViewer.FormFields.FormField,
) => {
    annotation?: NutrientViewer.Annotations.WidgetAnnotation;
    formField?: NutrientViewer.FormFields.FormField;
}

Example

Set the opacity of all widget annotations.

NutrientViewer.load({
onWidgetAnnotationCreationStart: (annotation, formField) => {
return { annotation: annotation.set('opacity', 0.7) };
}
// ...
});

Type Declaration

Parameters

The widget annotation that is about to be created.

The original form field that is associated with the widget annotation.

Returns

{ … }