# Duplicate XML annotation tags found when placing single annotations

**URL:** <https://pdfjs.community/t/duplicate-xml-annotation-tags-found-when-placing-single-annotations/3153>\
**Category:** Technical Support\
**Created:** [February 23, 2024, 1:08pm UTC](https://pdfjs.community/t/duplicate-xml-annotation-tags-found-when-placing-single-annotations/3153 "2024-02-23T13:08:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![retrotech](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@retrotech](https://pdfjs.community/u/retrotech)\
**Post date:** [February 23, 2024, 1:08pm UTC](https://pdfjs.community/t/duplicate-xml-annotation-tags-found-when-placing-single-annotations/3153/1 "2024-02-23T13:08:00Z")

</div>

**Which product are you using?**  
PDF.js Express Plus

**PDF.js Express Version**  
8.7.0

**Detailed description of issue**  
Placing one annotation results in the creation of multiple XML Tags in the XFDF String even if there is a single item visible on the annotations

**Does your issue happen with every document, or just one?**  
Attached the document  
[ESS01 ENG ICA RPO 0003 Rev A ESD Philosophy.pdf](https://pdfjs.community/uploads/short-url/eTIQsBoOek4smo5fnvT053aMeB0.pdf) (496.0 KB)

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [February 26, 2024, 4:01pm UTC](https://pdfjs.community/t/duplicate-xml-annotation-tags-found-when-placing-single-annotations/3153/2 "2024-02-26T16:01:20Z")

</div>

Hi there,

Loading the provided document into our demo [PDF.js Viewer Demo | PDF.js Express](https://pdfjs.express/demo)  
and getting the annotations on the document, there seems to be multiple link annotations that are in the 2nd page:

 ![image](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/2X/0/022f6cd98d0bfd6b92959c50b95d1250ce40fc37.jpeg)

Best regards,  
Kevin Kim

---

<div class="post-metadata">

**Author:** ![retrotech](https://avatars.discourse-cdn.com/v4/letter/r/a9a28c/32.png) [@retrotech](https://pdfjs.community/u/retrotech)\
**Post date:** [February 26, 2024, 5:15pm UTC](https://pdfjs.community/t/duplicate-xml-annotation-tags-found-when-placing-single-annotations/3153/3 "2024-02-26T17:15:33Z")

</div>

Hi. Is there a way to ignore the existing annotations and only export the recently added annotations?

---

<div class="post-metadata">

**Author:** ![kkim](https://avatars.discourse-cdn.com/v4/letter/k/3ab097/32.png) [@kkim](https://pdfjs.community/u/kkim)\
**Post date:** [February 26, 2024, 5:23pm UTC](https://pdfjs.community/t/duplicate-xml-annotation-tags-found-when-placing-single-annotations/3153/4 "2024-02-26T17:23:21Z")

</div>

Hi there,

One method would be to delete all the annotations that are inside the document when the document and annotations are loaded. Example in this guide here:

> **[Remove annotations to a PDF using JavaScript | PDF.js Express](https://pdfjs.express/documentation/annotation/remove-annotations)**

Another method is to pass in a list of only the annotations you want to export, via the options in the exportAnnotations API:  
[https://pdfjs.express/api/Core.AnnotationManager.html#:~:text=Description-,annotList,-Array.\<Core](https://pdfjs.express/api/Core.AnnotationManager.html#:~:text=Description-,annotList,-Array.%3CCore)

Best regards,  
Kevin Kim
