Get selected annotation id for modal

Which product are you using?
PDF.js Express Plus

PDF.js Express Version

Detailed description of issue
Can you provide a code sample to get the id of the currently selected annotation? I want to pass this to an external modal via querystring to bind the id of the annotation with an id from our own system.

Expected behaviour

Modal in action with our system id displayed.

Code snippet

Hi there,

Thanks for reaching out to pdf.js express forums,

You can find the properties for an annotation here:

const documentViewer = instance.Core.documentViewer;
const annotationManager = documentViewer.getAnnotationManager();
const selectedAnnotation = annotationManager.getSelectedAnnotations()[0]

Best regards,
Kevin Kim

Hi Kevin, yes that was it thanks.

Best regards.