I downloaded your code for Syncfusion Xamarin UI Controls from https://github.com/syncfusion/xamarin-demos
And then built SampleBrowser.PdfViewer successfully.
There is one strange thing which I don't understand.
In the first tab that opens "GIS Succinctly.pdf", I am not able to use the below code to annotate a text. But the same 2 lines of code works in the 3rd tab "Annotations.pdf". It annotates the text. I don't know what am I missing here. How do I annotate text in the first document?
TextMarkupAnnotation annotation = new TextMarkupAnnotation(TextMarkupAnnotationType.Highlight, 1, 20, 30); pdfViewerControl.AddAnnotation(annotation);
PS: The above code annotates in page number 1. In case of "GIS Succinctly.pdf" you would need to change the page number to 2 or 3 to check because there is no text in the first page.
MAManojKumar Arumugasamy Syncfusion Team February 15, 2023 12:57 PM UTC
Hi Gautam, We were
unable to reproduce the issue of adding text markup annotation
programmatically. For text markup to be added programmatically, you should know
the startindex and endindex of the words on the page. The pages without text
will not add text markup annotation.
We have attached a
video showing the programmatic addition of text markup annotation.