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