跳至内容

TextractDocument.html() returns LAYOUT error even after Job has completed with Layout Info

0

Periodically for some documents (PDFs) but I'm not able to understand why. Textract will not be able to determine the layout even though the layout information is in the blocks.

For example:

new TextractDocument({ Blocks: blocks } as any).html();

Will Return

Error: Page.html() is not yet implemented for results where Textract LAYOUT was not enabled

Inputs

const cmd = new StartDocumentAnalysisCommand({
      DocumentLocation: {
        S3Object: {
          Bucket: bucket,
          Name: key,
        },
      },
      FeatureTypes: ['LAYOUT'],
    });
    
    const resy = await textract.send(command);

已提问 2 年前146 查看次数

1 回答
0

Hi and thanks for raising this,

Since the hasLayout check looks for whether each page has any layout items, I think the most likely cause for this may be documents with blank pages?

Because this issue seems to be within the Open Source Amazon Textract Response Parser for JavaScript/TypeScript, it'd probably be helpful to raise it on the project GitHub. If you're able to confirm whether it's failing on only blank pages, or there are any other cases, that'd be super helpful information for the team to debug!

Update, 2024-11-19:

We've gone ahead and released a new version 0.4.3 of TRP.js to tackle the blank page issue - see the PR on GitHub and the version on NPM. Please try upgrading when you can, and let us know if it solves the issue or there's something else going on!

AWS
专家

已回答 2 年前

专家

已审核 2 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。