# Delete Image stamp annotation programatically

**URL:** <https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147>\
**Category:** Technical Support\
**Created:** [July 22, 2020, 2:19pm UTC](https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147 "2020-07-22T14:19:32Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Logan](https://yyz1.discourse-cdn.com/flex031/user_avatar/pdfjs.community/logan/32/13_2.png) [@Logan](https://pdfjs.community/u/Logan)\
**Post date:** [July 24, 2020, 9:18pm UTC](https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147/2 "2020-07-24T21:18:10Z")

</div>

Hi,

To delete all the stamp annotations you can use [getAnnotationsList](https://pdfjs.express/api/CoreControls.AnnotationManager.html#getAnnotationsList__anchor) to get a list of all the annotations, then filter to select only the stamp annotations, and then delete them with [deleteAnnotations](https://pdfjs.express/api/CoreControls.AnnotationManager.html#deleteAnnotations__anchor).

```javascript
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

---

_[View the full topic](https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147)._
