TableAbsorber Class
Represents an absorber object of table elements. Performs search and provides access to search results via TableList collection.
Inheritance Hierarchy
SystemObject
  Aspose.Pdf.TextTableAbsorber

Namespace: Aspose.Pdf.Text
Assembly: Aspose.PDF (in Aspose.PDF.dll) Version: 20.3
Syntax
public class TableAbsorber

The TableAbsorber type exposes the following members.

Constructors
  NameDescription
Public methodTableAbsorber
Initializes a new instance of the TableAbsorber.
Public methodTableAbsorber(TextSearchOptions)
Initializes a new instance of the TableAbsorber with text search options.
Properties
  NameDescription
Public propertyTableList
Returns readonly IList containing tables that were found
Public propertyTextSearchOptions
Gets or sets text search options.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodRemove
Removes an AbsorbedTable from the page.
Public methodReplace
Replaces an AbsorbedTable with Table on the page.
Public methodToString (Inherited from Object.)
Public methodCode exampleVisit
Extracts tables on the specified page
Examples
The example demonstrates how to find table on the first PDF document page and replace the text in a table cell.
C#
// Open document
Document doc = new Document(@"D:\Tests\input.pdf");

// Create TableAbsorber object to find tables
TableAbsorber absorber = new TableAbsorber();

// Visit first page with absorber
absorber.Visit(pdfDocument.Pages[1]);

// Get access to first table on page, their first cell and text fragments in it
TextFragment fragment = absorber.TableList[0].RowList[0].CellList[0].TextFragments[1];

// Change text of the first text fragment in the cell
fragment.Text = "hi world";

// Save document
doc.Save(@"D:\Tests\output.pdf");
See Also