How to Identify the Added Annotation Mode in ASP.NET MVC PDF Viewer

14 Aug 20261 minute to read

The PDF Viewer library allows you to identify whether the added annotations in a PDF document are UI drawn, imported, or existing annotations. Annotation mode can be identified using the annotationAddMode property of the annotationSelect event.

Step 1: Follow the steps provided in the link to create simple PDF Viewer sample.

Step 2: The following code snippet explains how to identify added annotation mode.

<div id="e-pv-e-sign-pdfViewer-div">
    @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").AnnotationSelect("annotationSelected").Render()
</div>

<script>
    function annotationSelected(args) {
        console.log(args.annotationAddMode);
    }
</script>
<div id="e-pv-e-sign-pdfViewer-div">
    @Html.EJS().PdfViewer("pdfviewer").DocumentPath("https://cdn.syncfusion.com/content/pdf/pdf-succinctly.pdf").AnnotationSelect("annotationSelected").Render()
</div>

<script>
    function annotationSelected(args) {
        console.log(args.annotationAddMode);
    }
</script>