About FreeHand Annotation

WebViewer Version:
@pdftron/webviewer”: “^10.1.0”,

Do you have an issue with a specific file(s)?
Can you reproduce using one of our samples or online demos?
Are you using the WebViewer server?
Does the issue only happen on certain browsers?
Is your issue related to a front-end framework?
Is your issue related to annotations?
Yes, FreeHand.

Please give a brief summary of your issue:
(Think of this as an email subject)

About FreeHand Annotation.

Please describe your issue and provide steps to reproduce it:
(The more descriptive your answer, the faster we are able to help you)

  1. case annotationChanged Event.
    sample code.
  .then(instance => {
    const { annotationManager } = instance.Core;

    annotationManager.addEventListener('annotationChanged', (annotations, action) => {
        console.log('-------------------onAnnotationChanged action=' + action);

1-1. Create freehand annotations.

LOG : console.log(‘-------------------onAnnotationChanged action=’ + action);
It may take a few seconds for the console.log to appear.

AnnotationChangeEvent is slow.
FreeHand only.

  1. case API : getAnnotationsList().
  public buttonClick = () => {
        const getAnnots =

    if (getAnnots.length > 0) {

2-1. Click the button immediately after creating the annotation.
Cannot be get with getAnnotationsList API.
(length === 0)

These incidents are freehand annotations only.

[Background for this topic]
Fired when the user clicks the DB save button right after creating a freehand annotation.
Are there any countermeasures?

Please provide a link to a minimal sample where the issue is reproducible:

Best Regards.


There is an expected delay in free hand annotation creation in order to capture multiple strokes as part of the same annotation. You can read more about that here and how to adjust that delay: Apryse Documentation | Documentation.

Let me know if that helps!


Thank you for the advice.
I tried this.
But it didn’t improve.

  .then(function(instance) {
   instance.Core.Tools.FreeHandCreateTool.prototype.createDelay = 0;

It looks like that code is a bit outdated and there is an API for that now: setCreateDelay. I think you may have to set it on each of the tools themselves:

const toolMap = instance.Core.documentViewer.getToolModeMap();
Object.keys(toolMap).forEach(toolKey => {
    if (toolKey.startsWith('AnnotationCreateFreeHand')) {
1 Like

This code worked very well for me.

Thank you!!