1 Answer
- Newest
- Most votes
- Most comments
0
Hi,
Encoded is not required using the SDK. Please find the code example below:
const { TextractClient } = require('@aws-sdk/client-textract');
async function main() {
const client = new TextractClient({
region: 'us-east-1',
});
const request = {
Document: {
S3Object: {
Bucket: 'my-bucket',
Name: 'my-file.pdf',
},
},
FeatureTypes: ['TABLES', 'FORMS'],
};
try {
const result = await client.send(new AnalyzeDocumentCommand(request));
console.log(result);
} catch (err) {
console.error(err);
}
}
main();
This code will send a request to the AWS Textract service to analyze the PDF file stored in the my-bucket S3 bucket with the name my-file.pdf and will return the analysis results to the result variable. The FeatureTypes parameter specifies which types of features to extract from the document, in this case tables and forms. You can find more information about the available feature types in the Textract documentation.
I hope this helps!
answered 3 years ago
Relevant content
- asked 3 years ago
