Delete Image stamp annotation programatically

Hi,

To delete all the stamp annotations you can use getAnnotationsList to get a list of all the annotations, then filter to select only the stamp annotations, and then delete them with deleteAnnotations.

Webviewer({
  initialDoc: hashFile,
  path: '/lib',
}, document.getElementById('viewer')).then(instance => {

  const { annotManager, docViewer, Annotations } = instance;
  docViewer.on('documentLoaded', () => {
    const list = annotManager.getAnnotationsList();
    const toBeDeleted = list.filter(annot => annot instanceof Annotations.StampAnnotation);
    annotManager.deleteAnnotations(toBeDeleted);
  })
});

Thanks,
Logan