documentCapture.Document

Note:

The content in this help topic pertains to SuiteScript 2.1.

Object Description

The extracted data from a document.

This object is returned from documentCapture.documentToStructure(options) and documentCapture.parseResult(options). It includes properties for the MIME type (Document.mimeType) and extracted pages (Document.pages) of a document. The data in this object is structured as follows:

                    {
    mimeType: string,
    pages: {
        fields: Field[],
        lines: Line[],
        tables: Table[],
        words: Word[]
    }
} 

                  

The data that's available in this object depends on the features you specify when you call documentCapture.documentToStructure(options), or when you submit an asynchronous extraction task then parse the result using documentCapture.parseResult(options). For example, this object includes fields (as documentCapture.Field objects) only when you specify the documentCapture.Feature.FIELD_EXTRACTION feature. If you don't specify any features, the documentCapture.Feature.TEXT_EXTRACTION and documentCapture.Feature.TABLE_EXTRACTION features are used by default.

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/documentCapture Module

Methods and Properties

Document Object Members

Since

2025.2

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/documentCapture Module Script Samples.

            // Add additional code
...

const extractedData = documentCapture.documentToStructure({
    file: file.load("SuiteScripts/sample_invoice.pdf"),
    documentType: documentCapture.DocumentType.INVOICE
});

...
// Add additional code 

          

Related Topics

General Notices