AnalyzeDocument
Source:
src/AWS/Textract/AnalyzeDocument.ts
Runtime binding for textract:AnalyzeDocument — synchronous analysis of
relationships in a document: forms (key-value pairs), tables, layout,
signatures, and natural-language queries. Pass the document as raw bytes
or as an S3 object reference; the caller needs s3:GetObject on the
bucket for S3 input (bind AWS.S3.GetObject(bucket) alongside).
Synchronous Analysis
Section titled “Synchronous Analysis”// initconst analyzeDocument = yield* AWS.Textract.AnalyzeDocument();
// runtimeconst result = yield* analyzeDocument({ Document: { Bytes: documentBytes }, FeatureTypes: ["FORMS", "TABLES"],});const tables = (result.Blocks ?? []).filter((b) => b.BlockType === "TABLE");