Iterate through the collection and print table cells.
The following example shows how to extract tables from the whole document:
// Create an instance of Parser classusing(Parserparser=newParser(filePath)){// Check if the document supports table extractionif(!parser.Features.Tables){Console.WriteLine("Document isn't supports tables extraction.");return;}// Create the layout of tablesTemplateTableLayoutlayout=newTemplateTableLayout(newdouble[]{50,95,275,415,485,545},newdouble[]{325,340,365,395});// Create the options for table extractionPageTableAreaOptionsoptions=newPageTableAreaOptions(layout);// Extract tables from the documentIEnumerable<PageTableArea>tables=parser.GetTables(options);// Iterate over tablesforeach(PageTableAreatintables){// Iterate over rowsfor(introw=0;row<t.RowCount;row++){// Iterate over columnsfor(intcolumn=0;column<t.ColumnCount;column++){// Get the table cellPageTableAreaCellcell=t[row,column];if(cell!=null){// Print the table cell textConsole.Write(cell.Text);Console.Write(" | ");}}Console.WriteLine();}Console.WriteLine();}}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples: