Some test text!

menu
search

Notes panel

Sometimes it is useful to display only a subset of annotations in the notes panel. This guide talks about how the notes panel can be configured to hide certain annotations by using the annotation's Listable property or the setCustomNoteFilter API.

linkListable

Listable is a property that exists on all types of annotations. It controls if an annotation should be shown in the notes panel. The following example shows how you can hide all rectangle annotations.

WebViewer({
  // your constructor options here
}, viewerElement)
  .then(function(instance) {
    var annotManager = instance.annotManager;

    annotManager.on('annotationChanged', function(e, annotations, action) {
      if (action === 'add') {
        var rectangles = annotations.filter(function(annot) {
          return annot instanceof instance.Annotations.RectangleAnnotation;
        });

        rectangles.forEach(function(rectangle) {
          rectangle.Listable = false;
        });     

        annotManager.drawAnnotationsFromList(rectangles);
        annotManager.trigger('annotationChanged', [rectangles, 'modify']);
      }
    })
  });

linksetCustomNoteFilter

An annotation will neither appear in thumbnails nor show in the printed document if it's not Listable. Sometimes we may just want to customize the notes panel and leave other components untouched. In this case, setCustomNoteFilter is the right choice.

WebViewer({
  // your constructor options here
}, viewerElement)
  .then(function(instance) {
    // only show non-rectangle annotations 
    instance.setCustomNoteFilter(function(annot) {
      return !(annot instanceof instance.Annotations.RectangleAnnotation); 
    })
  });

Get the answers you need: Support

close

Free Trial

Get unlimited trial usage of PDFTron SDK to bring accurate, reliable, and fast document processing capabilities to any application or workflow.

Select a platform to get started with your free trial.

Unlimited usage. No email address required.

PDFTron Receives USD$71 Million Growth Investment Led By Silversmith Capital Partners

Learn more
close