Identify added annotation mode in TypeScript PDF Viewer

14 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 ES6 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