예제 #1
0
        private string GetPdfText(PageData pageData, PdfTextSpan textSpan)
        {
            var result = new byte[(textSpan.Length + 1) * 2];

            NativeMethods.FPDFText_GetText(pageData.TextPage, textSpan.Offset, textSpan.Length, result);
            return(FPDFEncoding.GetString(result, 0, textSpan.Length * 2));
        }
예제 #2
0
 public string GetPdfText(PdfTextSpan textSpan)
 {
     using (var pageData = new PageData(_document, _form, textSpan.Page))
     {
         return(GetPdfText(pageData, textSpan));
     }
 }
예제 #3
0
 public IList <PdfRectangle> GetTextBounds(PdfTextSpan textSpan)
 {
     using (var pageData = new PageData(_document, _form, textSpan.Page))
     {
         return(GetTextBounds(pageData.TextPage, textSpan.Page, textSpan.Offset, textSpan.Length));
     }
 }
예제 #4
0
        public IList <PdfRectangle> GetTextBounds(PdfTextSpan textSpan)
        {
            var result = new List <PdfRectangle>();

            foreach (var rectangle in _document.GetTextBounds(textSpan))
            {
                result.Add(new PdfRectangle(
                               rectangle.Page + _startPage,
                               rectangle.Bounds
                               ));
            }

            return(result);
        }
예제 #5
0
 public bool GetWordAtPosition(PdfPoint location, double xTolerance, double yTolerance, out PdfTextSpan span)
 {
     return(_document.GetWordAtPosition(location, xTolerance, yTolerance, out span));
 }
예제 #6
0
 public string GetPdfText(PdfTextSpan textSpan)
 {
     return(_document.GetPdfText(textSpan));
 }
예제 #7
0
 /// <summary>
 /// Get all bounding rectangles for the text span.
 /// </summary>
 /// <description>
 /// The algorithm used to get the bounding rectangles tries to join
 /// adjacent character bounds into larger rectangles.
 /// </description>
 /// <param name="textSpan">The span to get the bounding rectangles for.</param>
 /// <returns>The bounding rectangles.</returns>
 public IList<PdfRectangle> GetTextBounds(PdfTextSpan textSpan)
 {
     return _file.GetTextBounds(textSpan);
 }
예제 #8
0
 /// <summary>
 /// Get all text matching the text span.
 /// </summary>
 /// <param name="textSpan">The span to get the text for.</param>
 /// <returns>The text matching the span.</returns>
 public string GetPdfText(PdfTextSpan textSpan)
 {
     return _file.GetPdfText(textSpan);
 }
예제 #9
0
 public IList <PdfRectangle> GetTextBounds(PdfTextSpan textSpan)
 {
     throw new NotImplementedException();
 }
예제 #10
0
 public string GetPdfText(PdfTextSpan textSpan)
 {
     throw new NotImplementedException();
 }
예제 #11
0
 public PdfMatch(string text, PdfTextSpan textSpan, int page)
 {
     Text     = text;
     TextSpan = textSpan;
     Page     = page;
 }