Which product are you using?
PDF.js Express
PDF.js Express Version
8.0.1
Detailed description of issue
When the event “annotationChanged” will call, I want to add/update/delete annotations based on conditions otherwise not. But now it always add/update/delete annotations even after I added my conditions.
Expected behaviour
After checking my condition. No annotation should be added/updated/deleted.
Does your issue happen with every document, or just one?
Issue happens with every document
Code snippet
annotationManager.addEventListener('annotationChanged', (annotations, action, { imported }) => {
if (imported) {
return;
} else if(myCondition){
// do something and return.
return;
} else {
if (action === 'add') {
console.log('this is a change that added annotations');
} else if (action === 'modify') {
console.log('this change modified annotations');
} else if (action === 'delete') {
console.log('there were annotations deleted');
}
}
});
Thanks