Class PdfExtractionResult
Represents the output of a PDF extraction operation, containing all extracted
tables and text content, along with document metadata.
Provides convenient methods to access specific portions of the extracted content.
------------------------------------------------
Usage:
var result = PdfExtractor.Extract("document.pdf");
// Access all tables
foreach (var table in result.Tables)
{
Console.WriteLine($"Table on page {table.PageNumber} with {table.RowCount} rows");
}
// Get tables from a specific page
var pageTables = result.GetTablesByPage(5);
// Get text from a specific page
var pageText = result.GetRawTextByPage(5);
// Get full text including tables
var fullText = result.FullText;
------------------------------------------------
Inheritance
Namespace: IronPdf.Extractions
Assembly: IronPdf.dll
Syntax
public class PdfExtractionResult : Object
Remarks
Important Considerations:
Performance: The FullText property is computed lazily, so it's only generated when first accessed.
Note: Table indices are 0-based and relative to each page, not the entire document.
Related Documentation:
How-To Guide: Working with Extraction Results
API Reference: Full API Documentation
Properties
FullText
Gets the full text of the document, including tables
Combines both the extracted text and the content of all tables in reading order.
Declaration
public string FullText { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Metadata
Document-level metadata
Contains information about the document, such as total pages and table counts.
Declaration
public DocumentMetadata Metadata { get; }
Property Value
| Type | Description |
|---|---|
| DocumentMetadata |
Tables
List of all extracted tables
Contains all tables detected and extracted from the PDF document.
Declaration
public List<TableObject> Tables { get; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<TableObject> |
Text
Extracted text content (outside of tables)
Contains text extracted from the PDF document, excluding text within tables.
Declaration
public TextContent Text { get; }
Property Value
| Type | Description |
|---|---|
| TextContent |
Methods
GetFullTextByPage(Int32)
Gets full text (with tables) for a specific page
Combines both the extracted text and the content of all tables from the specified page in reading order.
Declaration
public string GetFullTextByPage(int pageNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pageNumber | Page number (1-based) |
Returns
| Type | Description |
|---|---|
| System.String | Full text content from the specified page, including tables |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when |
GetFullTextByPageRange(Int32, Int32)
Gets full text (with tables) for a page range
Combines both the extracted text and the content of all tables from the specified page range in reading order.
Declaration
public string GetFullTextByPageRange(int startPage, int endPage)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | startPage | Starting page number (1-based, inclusive) |
| System.Int32 | endPage | Ending page number (1-based, inclusive) |
Returns
| Type | Description |
|---|---|
| System.String | Full text content from the specified page range, including tables |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when:
|
GetRawText()
Gets the raw text of the document, excluding tables
Returns only the text content, without any table content.
Declaration
public string GetRawText()
Returns
| Type | Description |
|---|---|
| System.String |
GetRawTextByPage(Int32)
Gets raw text for a specific page
Returns only the text content from the specified page, without any table content.
Declaration
public string GetRawTextByPage(int pageNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pageNumber | Page number (1-based) |
Returns
| Type | Description |
|---|---|
| System.String | Text content from the specified page |
GetRawTextByPageRange(Int32, Int32)
Gets raw text for a page range
Returns only the text content from the specified page range, without any table content.
Declaration
public string GetRawTextByPageRange(int startPage, int endPage)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | startPage | Starting page number (1-based, inclusive) |
| System.Int32 | endPage | Ending page number (1-based, inclusive) |
Returns
| Type | Description |
|---|---|
| System.String | Text content from the specified page range |
GetTableByPageAndIndex(Int32, Int32)
Gets a specific table by page number and table index on that page
Returns the table at the specified index on the specified page.
Declaration
public TableObject GetTableByPageAndIndex(int pageNumber, int tableIndexOnPage)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pageNumber | Page number (1-based) |
| System.Int32 | tableIndexOnPage | Table index on the page (0-based) |
Returns
| Type | Description |
|---|---|
| TableObject | A TableObject representing the specified table, or null if not found |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when:
|
GetTablesByPage(Int32)
Gets all tables from a specific page
Returns a list of all tables found on the specified page.
Declaration
public List<TableObject> GetTablesByPage(int pageNumber)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | pageNumber | Page number (1-based) |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<TableObject> | List of TableObject instances representing tables on the page |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when |
GetTablesByPageRange(Int32, Int32)
Gets all tables from a page range
Returns a list of all tables found within the specified page range.
Declaration
public List<TableObject> GetTablesByPageRange(int startPage, int endPage)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | startPage | Starting page number (1-based, inclusive) |
| System.Int32 | endPage | Ending page number (1-based, inclusive) |
Returns
| Type | Description |
|---|---|
| System.Collections.Generic.List<TableObject> | List of TableObject instances representing tables in the page range |
Exceptions
| Type | Condition |
|---|---|
| System.ArgumentOutOfRangeException | Thrown when:
|