Some test text!

Search
Hamburger Icon

Web / FAQ / FreeHandAnnotation creation delay

FreeHandAnnotation creation delay

When creating a FreeHand Annotation with WebViewer, there is an intentional delay applied to allow users to create the annotation with multiple strokes. Strokes within the short delay will be treated as part of the same annotation. Beyond the delay, strokes will be treated as a separate annotation. Take for example when drawing an 'X' on the page. Drawing it normally or quickly will ensure the two strokes are part of the same annotation. On the other hand, drawing one stroke and then waiting for more than one second before drawing the second stroke will get you two annotations: one for each stroke.

Delay demo

Due to the delay, the annotationChanged event will be delayed by some amount of time. This can be adjusted by setting the delay on the FreeHandCreateTool object:

const toolMap = documentViewer.getToolModeMap();
for (const tool of Object.values(toolMap)) {
  if (tool instanceof Tools.FreeHandCreateTool){
    tool.setCreateDelay(0);
  }
}

Note that removing the delay will prevent the creation of annotations with multiple strokes.

Get the answers you need: Chat with us