How to show the annotation on the PDF with selected xfdfString

sure zserviss, i will try and update you.

here, based on checkbox selected, i am passing the above image data as param and i have coded, this way:

setAnnotation(event: any) {
WebViewer(
{
path: ‘…/…/wv-resources/lib’,
},
this.viewer.nativeElement
).then((instance: any) => {
instance.docViewer.on(‘annotationsLoaded’, () => {
instance.showAnnotations(event.annotationString);
});
});
}
and during initialisation, i am calling the WebViewer inside ngAfterViewInit() and only this is called inside ngOnInit()
this.wvDocumentLoadedHandler = this.wvDocumentLoadedHandler.bind(this);

ngAfterViewInit(): void {
let doc = sessionStorage.getItem(‘pdfViewer’);
WebViewer(
{
path: ‘…/…/wv-resources/lib’,
},
this.viewer.nativeElement
).then((instance: any) => {
const { documentViewer, annotationManager } = instance.Core;
this.hidingButtons(instance);
instance.UI.loadDocument(this.base64ToBlob(doc), { filename: ‘myfile.pdf’ });
this.viewer.nativeElement.addEventListener(‘pageChanged’, (e: any) => {
const [pageNumber] = e.detail;
console.log(Current page is ${pageNumber});
});
// listening to annotations
annotationManager.addEventListener(‘annotationChanged’, (annotations: any, action: any) => {
if (action === ‘add’) {
// added alert message to capture message
}
});
});
}
when i have submitted alert message, i am capturing the export data using this,
instance.Core.annotationManager.exportAnnotations();
Thanks,
Rakshitha