We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Need help in annotation in PdfViewer

Hello, 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.


3 Replies

MA ManojKumar 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.


Attachment: Recorded_video_27801fc0.zip


GJ Gautam Jain February 16, 2023 10:16 AM UTC

Thanks a lot Manoj. I will check that and let you know.



MA ManojKumar Arumugasamy Syncfusion Team February 17, 2023 09:04 AM UTC

You’re welcome, Gautam.

Please let me know if you have any questions or need further assistance.


Loader.
Up arrow icon