Beispiel #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));
        }
Beispiel #2
0
 public string GetPdfText(PdfTextSpan textSpan)
 {
     using (var pageData = new PageData(_document, _form, textSpan.Page))
     {
         return(GetPdfText(pageData, textSpan));
     }
 }
Beispiel #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));
     }
 }
Beispiel #4
0
 public PdfMatch(string text, PdfTextSpan textSpan, int page)
 {
     Text     = text;
     TextSpan = textSpan;
     Page     = page;
 }
Beispiel #5
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));
 }
Beispiel #6
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));
 }