Skip to content

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);

asked 2 years ago143 views

1 Answer
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
EXPERT

answered 2 years ago

EXPERT

reviewed 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.