Hi,
I have a PDF with tabular data, and would like to retrieve the text blocks, their locations, and contents. Is this possible with Spire? I perused the API docs but found nothing related to text location.
PdfDocument doc = new PdfDocument();
doc.LoadFromFile("E:\\testdoc\\sample2.pdf");
List<PdfTextFindCollection> collections = new List<PdfTextFindCollection>();
Dictionary<PointF, string> textANDposition = new Dictionary<PointF, string>();
foreach (PdfPageBase page in doc.Pages)
{
PdfTextFindCollection collection = page.FindAllText();
collections.Add(collection);
}
foreach(PdfTextFindCollection collection in collections)
{
foreach(PdfTextFind find in collection.Finds)
{
PointF point = find.Position;
string str = find.MatchText;
textANDposition.Add(point, str);
}
}