DataExtractionAgentTools Class
Provides AI agent tools for extracting structured data from PDF documents and images. Supports extraction of text, forms, tables, and images as JSON output. Combines Smart Data Extractor and Smart Table Extractor capabilities.
Inherited Members
Namespace: Syncfusion.AI.AgentTools.DataExtraction
Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
Syntax
public class DataExtractionAgentTools : AgentToolBase
Constructors
DataExtractionAgentTools(DocumentStorageManager)
Initializes a new instance for DocumentStorage mode.
Declaration
public DataExtractionAgentTools(DocumentStorageManager storageManager)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentStorageManager | storageManager | The document storage manager to read documents from. |
DataExtractionAgentTools(String)
Initializes a new instance of the DataExtractionAgentTools class.
Declaration
public DataExtractionAgentTools(string outputDirectory = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | outputDirectory | Optional output directory for saving JSON files. |
Methods
ConvertPdfTableToMarkdown(String, Double, Int32, Int32, Boolean, String)
Converts tables from a PDF document into Markdown format.
Declaration
[Tool(Name = "ConvertPdfTableToMarkdown", Description = "Converts tables from PDF documents and scanned images into Markdown (MD) format. It analyzes visual table structures, including bordered and border-less tables, enabling developers to programmatically convert tabular content into clean and well-structured Markdown representations.")]
public AgentToolResult ConvertPdfTableToMarkdown([ToolParameter(Description = "Path to input PDF file")] string inputFilePath, [ToolParameter(Description = "Confidence threshold for table extraction (0.0-1.0)")] double confidenceThreshold = 0.6, [ToolParameter(Description = "Start page number for extraction (1-based). Use -1 for all pages")] int startPage = -1, [ToolParameter(Description = "End page number for extraction (1-based). Use -1 for all pages")] int endPage = -1, [ToolParameter(Description = "Enable detection of border-less tables")] bool detectBorderlessTables = true, [ToolParameter(Description = "Optional output Markdown (.md) file path")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputFilePath | Path to input PDF or image file. |
| System.Double | confidenceThreshold | Confidence threshold for table extraction (0.0-1.0). |
| System.Int32 | startPage | Start page number for extraction (1-based). Use -1 for all pages. |
| System.Int32 | endPage | End page number for extraction (1-based). Use -1 for all pages. |
| System.Boolean | detectBorderlessTables | Enable detection of border-less tables. |
| System.String | outputFilePath | Optional output Markdown (.md) file path. |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the extracted table Markdown data or error message. |
ConvertPdfToMarkdown(String, Boolean, Double, Int32, Int32, Boolean, String)
Converts a PDF document or image file into Markdown by extracting structured data.
Declaration
[Tool(Name = "ConvertPdfToMarkdown", Description = "Converts structured information from PDF documents and scanned images into Markdown (MD) format. It analyzes text blocks, tables and headers to preserve the original layout and formatting in the generated Markdown output.")]
public AgentToolResult ConvertPdfToMarkdown([ToolParameter(Description = "Path to input PDF file")] string inputFilePath, [ToolParameter(Description = "Enable table detection in the document")] bool enableTableDetection = true, [ToolParameter(Description = "Confidence threshold for extraction (0.0-1.0). Higher values return only high-confidence results")] double confidenceThreshold = 0.6, [ToolParameter(Description = "Start page number for extraction (1-based). Use -1 for all pages")] int startPage = -1, [ToolParameter(Description = "End page number for extraction (1-based). Use -1 for all pages")] int endPage = -1, [ToolParameter(Description = "Enable detection of border-less tables")] bool detectBorderlessTables = true, [ToolParameter(Description = "Optional output Markdown (.md) file path")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputFilePath | Path to input PDF or image file. |
| System.Boolean | enableTableDetection | Enable table detection in the document. |
| System.Double | confidenceThreshold | Confidence threshold for extraction (0.0-1.0). Higher values return only high-confidence results. |
| System.Int32 | startPage | Start page number for extraction (1-based). Use -1 for all pages. |
| System.Int32 | endPage | End page number for extraction (1-based). Use -1 for all pages. |
| System.Boolean | detectBorderlessTables | Enable detection of border-less tables. |
| System.String | outputFilePath | Optional output Markdown (.md) file path. |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the extracted Markdown data or error message. |
ExtractDataAsJson(String, Boolean, Boolean, Double, Int32, Int32, Boolean, Boolean, Boolean, Boolean, Boolean, String)
Extracts structured data including text, forms, tables, and images from a PDF document or image file.
Declaration
[Tool(Name = "ExtractDataAsJson", Description = "Extracts structured data including text, forms, tables, and images from a PDF document or image file and returns as JSON string. Supports form field detection with configurable options (signatures, textboxes, checkboxes, radio buttons) and table detection with border-less table support. Page range and confidence threshold can be specified for fine-tuned extraction.")]
public AgentToolResult ExtractDataAsJson([ToolParameter(Description = "Path to input PDF or image file (.pdf, .png, .jpg, .jpeg)")] string inputFilePath, [ToolParameter(Description = "Enable form field detection in the document")] bool enableFormDetection = true, [ToolParameter(Description = "Enable table detection in the document")] bool enableTableDetection = true, [ToolParameter(Description = "Confidence threshold for extraction (0.0-1.0). Higher values return only high-confidence results")] double confidenceThreshold = 0.6, [ToolParameter(Description = "Start page number for extraction (1-based). Use -1 for all pages")] int startPage = -1, [ToolParameter(Description = "End page number for extraction (1-based). Use -1 for all pages")] int endPage = -1, [ToolParameter(Description = "Detect signature fields in forms")] bool detectSignatures = true, [ToolParameter(Description = "Detect textbox fields in forms")] bool detectTextboxes = true, [ToolParameter(Description = "Detect checkbox fields in forms")] bool detectCheckboxes = true, [ToolParameter(Description = "Detect radio button fields in forms")] bool detectRadioButtons = true, [ToolParameter(Description = "Enable detection of border-less tables")] bool detectBorderlessTables = true, [ToolParameter(Description = "Optional output JSON file path to save the extracted data")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputFilePath | Path to input PDF or image file (.pdf, .png, .jpg, .jpeg). |
| System.Boolean | enableFormDetection | Enable form field detection in the document. |
| System.Boolean | enableTableDetection | Enable table detection in the document. |
| System.Double | confidenceThreshold | Confidence threshold for extraction (0.0-1.0). Higher values return only high-confidence results. |
| System.Int32 | startPage | Start page number for extraction (1-based). Use -1 for all pages. |
| System.Int32 | endPage | End page number for extraction (1-based). Use -1 for all pages. |
| System.Boolean | detectSignatures | Detect signature fields in forms. |
| System.Boolean | detectTextboxes | Detect textbox fields in forms. |
| System.Boolean | detectCheckboxes | Detect checkbox fields in forms. |
| System.Boolean | detectRadioButtons | Detect radio button fields in forms. |
| System.Boolean | detectBorderlessTables | Enable detection of border-less tables. |
| System.String | outputFilePath | Optional output JSON file path to save the extracted data. |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the extracted JSON data or error message. |
ExtractFormFieldsAsJson(String, Boolean, Boolean, Boolean, Boolean, Double, Int32, Int32, String)
Extracts only form field data from a PDF document and returns as JSON string.
Declaration
[Tool(Name = "ExtractFormFieldsAsJson", Description = "Extracts only form data from a PDF document and returns as JSON string. Optimized for form-focused extraction with support page range specification, and confidence thresholding. Use this method when you only need form data without table or other content.")]
public AgentToolResult ExtractFormFieldsAsJson([ToolParameter(Description = "Path to input PDF file")] string inputFilePath, [ToolParameter(Description = "Detect signature fields in forms")] bool detectSignatures = true, [ToolParameter(Description = "Detect textbox fields in forms")] bool detectTextboxes = true, [ToolParameter(Description = "Detect checkbox fields in forms")] bool detectCheckboxes = true, [ToolParameter(Description = "Detect radio button fields in forms")] bool detectRadioButtons = true, [ToolParameter(Description = "Confidence threshold for form recognition (0.0-1.0). Higher values return only high-confidence form fields")] double confidenceThreshold = 0.6, [ToolParameter(Description = "Start page number for recognition (1-based). Use -1 for all pages")] int startPage = -1, [ToolParameter(Description = "End page number for recognition (1-based). Use -1 for all pages")] int endPage = -1, [ToolParameter(Description = "Optional output JSON file path to save the recognized form fields")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputFilePath | Path to input PDF file. |
| System.Boolean | detectSignatures | Detect signature fields in forms. |
| System.Boolean | detectTextboxes | Detect textbox fields in forms. |
| System.Boolean | detectCheckboxes | Detect checkbox fields in forms. |
| System.Boolean | detectRadioButtons | Detect radio button fields in forms. |
| System.Double | confidenceThreshold | Confidence threshold for form recognition (0.0-1.0). Higher values return only high-confidence tables. |
| System.Int32 | startPage | Start page number for recognition (1-based). Use -1 for all pages. |
| System.Int32 | endPage | End page number for recognition (1-based). Use -1 for all pages. |
| System.String | outputFilePath | Optional output JSON file path to save the recognized form fields data. |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the recognized form fields JSON data or error message. |
ExtractTableAsJson(String, Boolean, Double, Int32, Int32, String)
Extracts only table data from a PDF document and returns as JSON string.
Declaration
[Tool(Name = "ExtractTableAsJson", Description = "Extracts only table data from a PDF document and returns as JSON string. Optimized for table-focused extraction with support for border-less table detection, page range specification, and confidence thresholding. Use this method when you only need table data without form fields or other content.")]
public AgentToolResult ExtractTableAsJson([ToolParameter(Description = "Path to input PDF file")] string inputFilePath, [ToolParameter(Description = "Enable detection of border-less tables")] bool detectBorderlessTables = true, [ToolParameter(Description = "Confidence threshold for table extraction (0.0-1.0). Higher values return only high-confidence tables")] double confidenceThreshold = 0.6, [ToolParameter(Description = "Start page number for extraction (1-based). Use -1 for all pages")] int startPage = -1, [ToolParameter(Description = "End page number for extraction (1-based). Use -1 for all pages")] int endPage = -1, [ToolParameter(Description = "Optional output JSON file path to save the extracted table data")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | inputFilePath | Path to input PDF file. |
| System.Boolean | detectBorderlessTables | Enable detection of border-less tables. |
| System.Double | confidenceThreshold | Confidence threshold for table extraction (0.0-1.0). Higher values return only high-confidence tables. |
| System.Int32 | startPage | Start page number for extraction (1-based). Use -1 for all pages. |
| System.Int32 | endPage | End page number for extraction (1-based). Use -1 for all pages. |
| System.String | outputFilePath | Optional output JSON file path to save the extracted table data. |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the extracted table JSON data or error message. |