Identify added annotation mode in JavaScript PDF Viewer

16 Oct 20251 minute to read

Determine whether an added annotation was UI-drawn, imported, or existing using the annotationAddMode property of the annotationSelect event.

Step 1: Follow the steps in the Get started with JavaScript ES5 PDF Viewer guide to create a sample.

Step 2: Use the following code to identify the added annotation mode.

viewer.annotationSelect =(args) =>{
console.log(args.annotationAddMode);
}

Find the sample: Identify added annotation mode