Upload the image you wish to read text from to your S3 bucket. I used a screenshot from a book in my Kindle library.

Goto IAM and assign AmazonTextractFullAccess to your user.

On your host machine that has node installed, create a directory called textract.

Create a package.json file in that directory:

{
  "name": "textract",
  "version": "1.0.0",
  "description": "Read text from an image",
  "dependencies": {
    "aws-sdk": "^2.1053.0"
    
  }
}

Create an index.js file and put this code in it replacing YOUR_ values:

  const fs = require('fs')
  const AWS = require("aws-sdk")
  const awsObj = new AWS.Textract({
    accessKeyId: YOUR_ACCESS_KEY_ID,
    secretAccessKey: YOUR_SECRET_ACCESS_KEY,
    region:YOUR_BUCKET_REGION
  }); 

  let file = 'YOUR_screenshot.png'
  let params = { 
    Document: { 
      S3Object: {
        Bucket: 'YOUR_BUCKETNAME,
        Name: file
      }   
    },  
    FeatureTypes: ["TABLES"]
  }

  awsObj.analyzeDocument(params, (err, data) => {
    if (err) {
      console.log(err)
    } else {
      //console.log(data)
      let text = ""
      for(let i in data.Blocks) {
        if (data.Blocks[i].BlockType !== "LINE") {
          continue
        }
        console.log(data.Blocks[i])
        // if the line starts at a point from the Left that is greater than .01, assume the line is indented and start a new line
        if (data.Blocks[i].Geometry.BoundingBox.Left > .01) {
          text+="\n"
        }
        text+=" " + data.Blocks[i].Text
      }   
      console.log(text)
      fs.writeFile(file + ".txt", text, function (err) {
        if (err) return console.log(err);
        console.log('done');
      }); 
    }   
  })  

In the textract directory, on the command line run:

npm install

And then run:

node index.js

You'll get a lot of interesting output and the text in the image written to a file on your host machine as well as printed to the console.