# Add Annotation from top bar

**URL:** <https://pdfjs.community/t/add-annotation-from-top-bar/541>\
**Category:** Technical Support\
**Created:** [February 25, 2021, 2:43pm UTC](https://pdfjs.community/t/add-annotation-from-top-bar/541 "2021-02-25T14:43:18Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![lganswindt](https://avatars.discourse-cdn.com/v4/letter/l/7c8e57/32.png) [@lganswindt](https://pdfjs.community/u/lganswindt)\
**Post date:** [February 25, 2021, 2:43pm UTC](https://pdfjs.community/t/add-annotation-from-top-bar/541/1 "2021-02-25T14:43:18Z")

</div>

**PDF.js Express Version**  
6.14.9

**Detailed description of issue**  
We are trying to add text annotations with the default tool annotations header. When I added the text per click, this xml is created:

![3](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/591bd47cdf59ffdf6324b3dd0054c32014506549.png)

In the content section to may “&quot” are printed.

If we move the text or change the content of the annotation, the XML is changed and printed the correct way.

**Expected behaviour**  
We would expect the webviewer to export the annotation the right way right at the beginning and not only, when it got changed.

**Does your issue happen with every document, or just one?**  
With every document

**Code snippet**

```javascript
    annotManager.exportAnnotations({ links: false, widgets: false, annotList: annotList }).then( xfdfString => {
                  console.log(xfdfString)

                  instance.docViewer.getDocument().getFileData({xfdfString}).then(function (data) {
                    const arr = new Uint8Array(data);
                    var blob = new Blob([arr], {type: 'application/pdf'});
                    var reader = new FileReader();
                    reader.readAsDataURL(blob);
                    reader.onloadend = function () {
                      app.file.base64 = reader.result;
                      app.file.base_64_string = app.file.base64.split(',')[1];
                      app.file.atob = atob(reader.result.replace('data:application/pdf;base64,', ''));
                      app.file.file_name = app.file_name;
                      app.file.xfdf = xfdfString;
                    }
                  })
                });

```

---

_[View the full topic](https://pdfjs.community/t/add-annotation-from-top-bar/541)._
