跳至內容

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 年前檢視次數 147 次

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 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。