We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

PDFViewer - Annotations Area Customization

Hi

Is there any option to hide the Export/Import menu on the comments area and to hide the "Set Status" option for each annotation?

Thanks.


1 Reply

CK Chinnamunia Karthik Chinna Thambi Syncfusion Team March 23, 2023 01:48 PM UTC

Please find the details.


Hide the Export/Import menu on the comments area 

 

Kindly set the pdfViewer_annotations_btn display as none!important to hide the Export/Import option in the comment panel.

Code snippet:

 

#pdfViewer_annotations_btn{

    display: none !important;

}

 

Sample: https://stackblitz.com/edit/v35mhn?file=index.html
 

Hide the "Set Status" option 

 

Refer the below code snippet and sample for how to hide the "Set Status" option. In the given sample, We hide the "Set Status" option using the annotationAdd and annotationSelect API.

Code snippet:

 

    viewer.annotationAdd = function(args) {

        var pdfViewer = document.getElementById('pdfViewer_comment_context_menu')

          .ej2_instances[0];

        var length = pdfViewer.items.length;

        for (var x = 0; x < length; x++) {

            if (pdfViewer.items[x].text === 'Set Status') {

                var id = pdfViewer.items[x].id;

                document.getElementById(id).style.visibility = 'hidden';

            }

        }

    }

 

    viewer.annotationSelect = function(args) {

        var pdfViewer = document.getElementById('pdfViewer_comment_context_menu')

          .ej2_instances[0];

        var length = pdfViewer.items.length;

        for (var x = 0; x < length; x++) {

            if (pdfViewer.items[x].text === 'Set Status') {

                var id = pdfViewer.items[x].id;

                document.getElementById(id).style.visibility = 'hidden';

            }

        }

    }

 

    viewer.documentLoad = function(args) {

        var input = document.getElementById('pdfViewer_comment_context_menu');

        if (input) {

          input.remove();

        }

    }


Sample: https://stackblitz.com/edit/cudwck?file=index.html,index.js
 


Loader.
Up arrow icon