We are trying integrate amazon Textract api in our node.js application. we are facing some issue, FeatureType parameter while processing image. we need to achieve the below option via api:
We are not finding the option in the AWS JavaScript SDK.
export type FeatureType = "TABLES"|"FORMS"|string;
I'm trying this code:
const params = {
Document: {
/* required */
Bytes: Buffer.from(fileData)
},
FeatureTypes: [""] // here i'm facing issue, if i pass "TABLES"|"FORMS" it working
};
var textract = new AWS.Textract({
region: awsConfig.awsRegion,
accessKeyId: awsConfig.awsAccesskeyID,
secretAccessKey: awsConfig.awsSecretAccessKey
})
textract.analyzeDocument(params, (err, data) => {
console.log(err, data)
if (err) {
return resolve(err)
} else {
resolve(data)
}
})
Getting this error:
InvalidParameterType: Expected params.FeatureTypes[0] to be a string
If I pass "TABLES"|"FORMS" its working but I need Raw Text option.
Thanks in advance