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
The record a developer receives after calling PdfExtractor.Extract is a PdfExtractionResult, the single object that bundles every table, every text layer, and the document metadata produced by one extraction pass. Rather than making separate calls for tables and text, you query this result object to slice the output by page, page range, or the whole document.
PdfExtractionResult organises its surface into two functional areas: structured table data and text content.
**Tables:** Tables returns the full List<TableObject> found across the document. When you need only one page, GetTablesByPage(int pageNumber) narrows the list. For a contiguous span of pages, GetTablesByPageRange(int startPage, int endPage) covers the range. To pinpoint a single table when a page holds more than one, GetTableByPageAndIndex(int pageNumber, int tableIndexOnPage) selects by zero-based position on that page.
**Text:** FullText exposes the complete formatted text string for the document. Text gives a TextContent object for richer programmatic access. The Get-prefixed text methods mirror the table methods: GetFullTextByPage and GetFullTextByPageRange return formatted text; GetRawText, GetRawTextByPage, and GetRawTextByPageRange return unformatted strings stripped of layout hints, which is useful when feeding content to a parser or search index.
Metadata surfaces a DocumentMetadata record containing author, title, creation date, and related document-level properties.
A common workflow reads all tables from a report, then pulls the raw text from the same pages to feed a downstream pipeline:
using IronPdf.Extractions;
PdfExtractionResult result = PdfExtractor.Extract("annual-report.pdf");
// Inspect document metadata
Console.WriteLine(result.Metadata.Title);
// Iterate every table in the document
foreach (TableObject table in result.Tables)
Console.WriteLine($"Page {table.PageNumber}: {table.RowCount} rows");
// Pull raw text from pages 3 through 7 for indexing
string rawSlice = result.GetRawTextByPageRange(3, 7);For a broader look at PDF content extraction in IronPDF, see the PDF extraction how-to, the text extraction examples, and the table extraction tutorial. The IronPDF documentation hub covers installation and licensing.
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:
|