Skip to main content

Amazon Textract

See Amazon Textract Developer Guide for general guidance using Textract.

API Access

The ITextractClient interface and its implementation TTextractClient provides access to all Textract operations.

program ExtractText;

uses
AWS.Textract;

var
Client: ITextractClient;
Request: ITextractDetectDocumentTextRequest;
Response: ITextractDetectDocumentTextResponse;

begin
Client := TTextractClient.Create;

Request := TTextractDetectDocumentTextRequest.Create;
Request.Document := TTextractDocument.FromFile('Path\\To\\Image.jpg');
try
Response := Client.DetectDocumentText(Request);
// Inspect Response which includes text Blocks and DocumentMetadata.
except
on E: ETextractException do
Writeln(E.ClassName, ': ', E.Message);
end;
end.

Analyzing Documents

Input documents can be analyzed for relationships between detected items using AnalyzeDocument. Alternatively, documents can be analyzed asynchronously using StartDocumentAnalysis and the results can be fetched at a later time with GetDocumentAnalysis.

Analyzing Expense Documents

Expense related information can be extracted from invoices/receipts using AnalyzeExpense. Alternatively, expense documents can be analyzed asynchronously using StartExpenseAnalysis and the results can be retrieved later using GetExpenseAnalysis.

Analyzing Lending Documents

Lending documents can be analyzed using the StartLendingAnalysis function. Results can be retrieved later using GetLendingAnalysis.

Analyzing Identity Documents

Identity documents can be analyzed using AnalyzeID.

Detecting Text

Text can be detected in an input document using DetectDocumentText. Text can be extracted asynchronously using StartDocumentTextDetection and the results can be retrieved later using GetDocumentTextDetection.