1

I am working on AWS textract to extract text, form and tables from document like PDF and Image . If anyone has a solution with AWS sdk php, please share your answer with me.

$image = $request->file('bill_file');
$imagePath = $image->getPathName();
$fp_image = fopen($imagePath, 'rb');
$image = fread($fp_image, filesize($imagePath));
fclose($fp_image);
$client = new TextractClient([
'version'     => '2018-06-27',
'region'      => 'XXXXXXXXX',
'credentials' => [
'key'    => 'XXXXXXXXXXXXXXXXXX',
'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
]

]);
$options = [
'Document' => [
'Bytes' => $image
],
'FeatureTypes' => ['FORMS','TABLES'], 
];
$result = $client->analyzeDocument($options);
$blocks = $result['Blocks'];

this code gave me text, line, table table cell and forms

how to print table with cell with text and line, i am using laravel 5.7

4
  • like that?LINK Feb 12, 2020 at 13:46
  • Hi did you solve this?
    – Albert
    Dec 3, 2021 at 2:51
  • textract is working good but i only able to store the extracted text in json format Dec 6, 2021 at 6:13
  • can you share me how did you do It. I'm having hard time using asynchronous
    – Albert
    Dec 13, 2021 at 5:48

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.