# 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:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![abhishek11.maurya199](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@abhishek11.maurya199](https://pdfjs.community/u/abhishek11.maurya199)\
**Post date:** [July 22, 2020, 2:19pm UTC](https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147/1 "2020-07-22T14:19:32Z")

</div>

Hello,

Is it possible to delete just image type stamp programatically  
for all authors?  
if not then can you suggest any way to achieve it.

Regards  
Abhishek Maurya

---

<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

---

<div class="post-metadata">

**Author:** ![abhishek11.maurya199](https://avatars.discourse-cdn.com/v4/letter/a/ed655f/32.png) [@abhishek11.maurya199](https://pdfjs.community/u/abhishek11.maurya199)\
**Post date:** [July 29, 2020, 9:06am UTC](https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147/3 "2020-07-29T09:06:10Z")

</div>

Thank you for the solution!

---

<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 29, 2020, 2:29pm UTC](https://pdfjs.community/t/delete-image-stamp-annotation-programatically/147/4 "2020-07-29T14:29:54Z")

</div>


