スキップしてコンテンツを表示

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年前152ビュー

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

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

関連するコンテンツ