내용으로 건너뛰기

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년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

관련 콘텐츠