CmdID / aws / aws textract
aws textract detect-document-text
Detects text in the input document. AWS CLI reference
1 example 1 option Its page in the AWS CLI reference
Examples
To detect text in a document
The following detect-document-text example shows how to detect text in a document.
For Linux and macOS, use the following command.
aws textract detect-document-text --document '{"S3Object":{"Bucket":"amzn-s3-demo-bucket","Name":"document"}}'Identify--documentThe input document as base64-encoded bytes or an Amazon S3 object.For Windows, use the following command.
aws textract detect-document-text --document "{\"S3Object\":{\"Bucket\":\"amzn-s3-demo-bucket\",\"Name\":\"document\"}}"Identify--documentThe input document as base64-encoded bytes or an Amazon S3 object.Its output, shortened
{
"Blocks": [
{
"Geometry": {
"BoundingBox": {
"Width": 1.0,
"Top": 0.0,
"Left": 0.0,
"Height": 1.0
},
"Polygon": [
{
"Y": 0.0,
"X": 0.0
},
{
"Y": 0.0,
"X": 1.0
},
{
"Y": 1.0,
"X": 1.0
},
{
"Y": 1.0,
"X": 0.0
}
]
},
"Relationships": [
… 98 more linesFor more information, see Detecting Document Text with Amazon Textract in the Amazon Textract Developer Guide.
Options
--documentThe input document as base64-encoded bytes or an Amazon S3 object.