Hello, I am having trouble in removing a highlight annotation from pdf on Xamarin Android. I'm successfully able to add highlights but can't seem to figure out why removing them using RemoveFromPage() won't work.
Here are some details
Triple checked package name and everything related to licensing (we are using professional version).
Successfully implemented Xamarin.iOS adding and removing highlights. We are not mistakenly using the same package name from the iOS app
We are asking to render the page again after removing annotation.
We are using the latest version (at the writing of this post).
Here is some code:
NativePage is Page.Annotation class from Com.radaee.pdf
public Task<ICorePdfAnnotation> AddHighlight(ICorePdfSel selection, string color)
if (!InitObjs()) return Task.FromResult((ICorePdfAnnotation)null);
var status = NativePage?.AddAnnotMarkup(selection.StartIndex, selection.EndIndex, 0) == true;
ICorePdfAnnotation result = null;
var annotation = NativePage?.GetAnnot(NativePage.AnnotCount - 1);
var colorObj = Color.ParseColor(color);
result = new AndroidPdfAnnotationWrapper(annotation);
Then the wrapper class:
public class AndroidPdfAnnotationWrapper : ICorePdfAnnotation
private Page.Annotation annotation;
public AndroidPdfAnnotationWrapper(Page.Annotation annotation)
this.annotation = annotation;
public bool Remove()
var status = annotation.RemoveFromPage();
the "status" return is always false
Any other additional debugging tips you guys could share?