got it Kevin i will try now, i have changed in developer console and tried but still get same issue, even in application also same issue. here i should be able to select checkbox show annotation on PDF, when unchecked remove annotation from pdf, so multiple annotations can be added/removed based on selection of checkbox.
here, deleting all annotations at one time works fine with this code,
const annotationsList = annotationManager.getAnnotationsList();
annotationManager.deleteAnnotations(annotationsList);
but deleting individual annotation based on uncheck is failing.
i even tried with this,
const annotationlist = annotationManager.getAnnotationsList();
let xfdfString = `<?xml version="1.0" encoding="UTF-8" ?><xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve"><pdf-info xmlns="http://www.pdftron.com/pdfinfo" version="2" import-version="4" /><fields /><annots><square page="0" rect="75.420,517.250,276.090,673.480" color="#E44234" flags="print" name="2bdc9ec3-5f5f-9957-fc14-29bfdf924e89" title="Guest" subject="Rectangle" date="D:20220914102039-07'00'" opacity="0.8530899712330127" creationdate="D:20220914102039-07'00'"/></annots><pages><defmtx matrix="1,0,0,-1,0,792" /></pages></xfdf>`
const index: number = this.annotationList.indexOf(xfdfString);
annotationManager.deleteAnnotations(selectedAnnotation);
failed here as well.