public static Point GetTextCoordinate(string textToFind, string pdfFilename, int pageNumber) { var texts = ExtractText(pdfFilename, pageNumber); (var chars, var points) = getAllTextLocations(texts); (var firstIndex, var lastIndex) = TextTools.SearchForStringInStringArray(textToFind, chars.ToArray()); if (firstIndex == -1) { return(new Point("-1,-1")); } var X = (points[firstIndex].X + points[lastIndex].X) / 2; var Y = points[firstIndex].Y; return(new Point(X, Y)); }