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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

iOS Negatives Coordinates

Thread ID:





140678 Oct 31,2018 12:30 PM UTC Nov 5,2018 11:46 AM UTC Xamarin.Forms 3
Tags: PdfViewer
Asked On October 31, 2018 12:30 PM UTC

Recently I used the pdf controls and I got something weird with iOS coordinates. Using the below function in an Android device I got the correct coordinates, but if I use an iOS device the coordinates aren't the same. For example, using Android device I got 


and using iOS device:


X, Width and Height are 100 times the same but Y coordinate doesn't make sense for me. It's a negative coordinate and I couldn't find the relationship with the others.

How do you get the Y coordinate in a iDevice?

Hope you can help me.


        public static MemoryStream HighLightPdf(this byte[] bytes, Dictionary<string, IList<string>> words)
            Color color = Color.Yellow;

            PdfLoadedDocument doc = new PdfLoadedDocument(bytes);
            Dictionary<int, List<RectangleF>> matchRect = new Dictionary<int, List<RectangleF>>();

            foreach (var key in words.Keys)
                if (key == "Locations")
                    color = Color.Blue;
                else if (key == "Organizations")
                    color = Color.Red;
                else if (key == "People")
                    color = Color.Green;

                foreach (var word in words[key])
                    var matched = doc.FindText(word, out matchRect);
                    if (matched)
                        foreach (KeyValuePair<int, List<RectangleF>> item in matchRect)
                            PdfLoadedPage page = doc.Pages[item.Key] as PdfLoadedPage;
                            foreach (var rect in item.Value)

                                PdfTextMarkupAnnotation textannot = new PdfTextMarkupAnnotation(newRect);
                                textannot.TextMarkupAnnotationType = PdfTextMarkupAnnotationType.Highlight;
                                textannot.TextMarkupColor = new PdfColor(color);
            MemoryStream memStream = new MemoryStream();
            return memStream;

Karthik Krishnaraj [Syncfusion]
Replied On November 1, 2018 02:23 PM UTC

Hi Laura, 
Greetings from Syncfusion, 
We were unable to reproduce the issue with provided information. We are getting the coordinate value of searched text same as in android. I have attached a sample which we tried in our side. Can you please modify the sample to replicate the issue and share with us? It will be helpful for us to analyze further and provide better solution. 
Sample Link: 

Replied On November 2, 2018 08:59 AM UTC

We've tested the program on the emulator and on the devices and the results obtained were different. When testing on the emulator, coordinates are correct but trying it on the device, either Android or iOS,  coordinates are wrong.

Dilli Babu Nandha Gopal [Syncfusion]
Replied On November 5, 2018 11:46 AM UTC

Hi Laura, 

We are afraid that we are unable to reproduce the issue “Bounds of the specified text is not approximate in emulator and device” while deploying the application in Xamarin.Forms Android and Xamarin.Forms iOS. We suspect that the issue is specific to the PDF document. So, we request you to share us the PDF document with which the issue could be reproduced. 
Note: If you have any confidential data in your PDF document, please replace with some dummy data and provide us the same. Kindly check whether the issue is reproduced with this document We just need your document to recreate the problem you face. 
Also provide the following details which will help us to reproduce the issue, 

  1. Device details (Android/iOS) with model name 
  2. Syncfusion Essential Studio 
  3. Device culture information 
  4. Issue reproducing sample 

Please let us know if you have any questions. 

Dilli babu. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon