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