# Unable to see/add annotations

**URL:** <https://pdfjs.community/t/unable-to-see-add-annotations/1919>\
**Category:** Technical Support\
**Tags:** pdfjs-express\
**Created:** [August 4, 2022, 1:53am UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919 "2022-08-04T01:53:11Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![karin](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@karin](https://pdfjs.community/u/karin)\
**Post date:** [August 4, 2022, 1:53am UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919/1 "2022-08-04T01:53:11Z")

</div>

**Which product are you using?**  
PDF.js Express Plus – paid for license

**PDF.js Express Version**  
|UI version|‘8.4.1’|  
|Core version|‘8.4.0’|

**Detailed description of issue**  
Hi there! I am looking for some assistance in being able to get my annotations working. I have not been able to find examples/documentation with a full working version.  
Key functionalities I need:

1. Load document in the document viewer (working)
2. load/see existing annotations (XDF)
3. create/add annotations
4. save annotations
5. send annotations XDF to third party API
6. repeat

Currently I am able to get the ribbon toolbar working via the ui.instance.enableElements([“”]) method, but nothing happens when I click any of the icons (free text tool, highlight, etc). I get an error

 ![Screen Shot 2022-08-03 at 3.49.14 PM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/a5834ce7c40d4ff4ee968f7de154102c1319bfc6.jpeg)

**Expected behaviour**  
Would love to be able to utilize the annotation tools

**Does your issue happen with every document, or just one?**  
All documents/haven’t been able to get it to work yet

**Link to document**  
{Provide a link to the document in question if possible}

**Code snippet**

```javascript
 WebViewer(
        {
          path: `${process.env.PUBLIC_URL}/pdfjsexpress`,
          initialDoc: "",
          disableFlattenedAnnotations: true,
        },
        viewer.current,
      )
        .then((instance) => {
          const utils = new ExpressUtils();

          const { docViewer, Core, annotManager } = instance;

          instance.UI.loadDocument(
             "https://pdftron.s3.amazonaws.com/downloads/pl/demo-annotated.pdf",
,
            { filename: "myfile.pdf" },
          );

          instance.UI.setTheme("dark");

          instance.UI.enableElements([
            "ribbons",
            "toolsHeader",
            "leftPanel",
            "leftPanelButton",
          ]);

          docViewer.addEventListener("documentLoaded", async () => {
            console.log("document loaded");
          });
        })

```

I have tried this snippet found in docs already (only to test something that would show up – didn’t work):

```javascript
     // const annotManager = docViewer.getAnnotationManager();
          // const rectangle = new Annotations.RectangleAnnotation();
          // rectangle.PageNumber = 2;
          // rectangle.X = 100;
          // rectangle.Y = 100;
          // rectangle.Width = 250;
          // rectangle.Height = 250;
          // rectangle.Author = annotManager.getCurrentUser();
          // annotManager.addAnnotation(rectangle);

          // docViewer.displayLastPage();

```

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/ffbcd25c7d423db8d5acd5db201c272f4db306dd.png) [@system](https://pdfjs.community/u/system)\
**Post date:** [August 4, 2022, 1:53am UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919/3 "2022-08-04T01:53:17Z")

</div>

**Hello, I’m Ron, an automated tech support bot 🤖**

While you wait for one of our customer support representatives to get back to you, please check out some of these documentation pages:

Guides:
- [Core engine for WebViewer - Creating your own UI using WebViewer Core](https://pdfjs.express/documentation/ui-customization/core#creating-your-own-ui-using-webviewer-core)
- [PDF.js Express Documentation - Annotation](https://pdfjs.express/documentation#annotation-<span-class='plus'></span>)
- [PDF.js Express Utility API](https://pdfjs.express/documentation/utils)

APIs:
- [PDF.js Express Utilities](https://pdfjs.express/api/utils/index.html#__anchor)
- [ExpressUtils(optionsopt) - # async set() → {Promise.}](https://pdfjs.express/api/utils/ExpressUtils.html#set__anchor)
- [UndefinedannotationsLoaded](https://pdfjs.express/api/namespaces.list.html#event:annotationsLoaded__anchor)

Forums:
- [Save PDF in ours servers](https://pdfjs.community/t/save-pdf-in-ours-servers/1154/4)
- [Viewer displays PDF correctly / Merged PDF file missing form fields](https://pdfjs.community/t/viewer-displays-pdf-correctly-merged-pdf-file-missing-form-fields/1912/1)
- [Annotations (comments ex) causing JS error: won’t render](https://pdfjs.community/t/annotations-comments-ex-causing-js-error-wont-render/1777/1)

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [August 4, 2022, 4:50pm UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919/4 "2022-08-04T16:50:04Z")

</div>

Hello karin,

Is this happening with v8.7 of PDFJS Express? we have recently released this version which includes numerous bug fixes.

Best regards,  
Tyler Gordon  
Web Development Support Engineer  
PDFTron

---

<div class="post-metadata">

**Author:** ![karin](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@karin](https://pdfjs.community/u/karin)\
**Post date:** [August 4, 2022, 9:12pm UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919/5 "2022-08-04T21:12:50Z")

</div>

Yes I am currently using v8.7

 ![Screen Shot 2022-08-04 at 11.12.36 AM](https://canada1.discourse-cdn.com/flex031/uploads/pdfjscommunity/original/1X/a1efa9856438d05d90160c2b9a0f8980c1896bf4.png)

---

<div class="post-metadata">

**Author:** ![karin](https://avatars.discourse-cdn.com/v4/letter/k/c37758/32.png) [@karin](https://pdfjs.community/u/karin)\
**Post date:** [August 4, 2022, 9:28pm UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919/6 "2022-08-04T21:28:52Z")

</div>

Would you be able to provide a working example with full annotation capabilities as a reference (especially the functionalities I listed 🙂 )

---

<div class="post-metadata">

**Author:** ![tgordon](https://avatars.discourse-cdn.com/v4/letter/t/aca169/32.png) [@tgordon](https://pdfjs.community/u/tgordon)\
**Post date:** [August 8, 2022, 5:07pm UTC](https://pdfjs.community/t/unable-to-see-add-annotations/1919/7 "2022-08-08T17:07:50Z")

</div>

Hello karin,

In the original post you mentioned you’re using v8.4.1, it is v8.7.0 now? Are you seeing the error on v8.7?

`Would you be able to provide a working example with full annotation capabilities as a reference (especially the functionalities I listed)`  
Can you clarify what you mean by this? We have our documentation guides on our annotation capabilities here: [PDF.js Express Annotations | Documentation](https://pdfjs.express/documentation/annotation/overview)

Best regards,  
Tyler Gordon  
Web Development Support Engineer  
PDFTron
