コード例 #1
0
        public static Point GetCharCoordinate(string textToFind, string pdfFilename, int pageNumber)
        {
            var textToFound = textToFind.ToCharArray();
            var texts       = ExtractText(pdfFilename, pageNumber);

            (var chars, var points) = getAllPoints(texts);

            var position = TextTools.SearchForChar(textToFound, chars.ToArray());

            if (position == -1)
            {
                return(new Point("-1,-1"));
            }

            var X = (points[position].X + points[position + textToFound.Length - 1].X) / 2;
            var Y = points[position].Y;

            return(new Point(X, Y));
        }