annotationManager.getAnnotationsList() returns nothing

Which product are you using?

PDF.js Express Version

Detailed description of issue
{ I’m trying to retrieve existing annotations in my document, to be more specific, bookmarks etc. However the annotationsList return an empty list.

Expected behaviour
{It should return a list of bookmarks with informations such as subject }

Does your issue happen with every document, or just one?
{This is the first time we are using this, and we are using PDF.JS Express Plus which is the pro version I believe? Also, I am in the development mode, does that make a difference?}

Link to document
{
doc.pdf (2.2 MB)
}

Code snippet
{
const annotManager = instance.Core.annotationManager;
const docViewer = instance.Core.documentViewer;
docViewer.addEventListener(‘annotationsLoaded’, () => {

           const annotationsList = annotManager.getAnnotationsList();

}
})
}

Hello there,

We were able to reproduce this issue regarding the missing annotations. We believe it is because the annotations are malformed. We have added this issue to our backlog for our product team to review.

Best Regards,
Darian Chen

Hello,

We noticed under your expected behaviour that you want to return bookmarks.

You can get bookmarks like this:

await documentViewer.getDocument().getBookmarks()

Best Regards,
Darian