Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
Toggle table of contents sidebar

# DocumentReader.readDocument Method

Module: DocumentReader

## Definition

Reads all the fields in a document.

Python

    read_document(self, image: DocumentImage, document_name: str) -> TextFieldList

Parameters

> `image` DocumentImage
> in The image that contains the document. Must be a realigned BGR image of the document.
> `document_name` str
> in The name of the document to be searched. Must be a key loaded in DocumentLibrary.

Returns

> TextFieldList
> A list of all the text fields read in the document.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Dart

    TextFieldList readDocument(DocumentImage image, String? documentName)

Parameters

> `image` DocumentImage
> in The image that contains the document. Must be a realigned BGR image of the document.
> `documentName` String
> in The name of the document to be searched. Must be a key loaded in DocumentLibrary.

Returns

> TextFieldList
> A list of all the text fields read in the document.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C#

    public TextFieldList ReadDocument(DocumentImage image, string documentName)

Parameters

> `image` DocumentImage
> in The image that contains the document. Must be a realigned BGR image of the document.
> `documentName` string
> in The name of the document to be searched. Must be a key loaded in DocumentLibrary.

Returns

> TextFieldList
> A list of all the text fields read in the document.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Java

    public TextFieldList readDocument(DocumentImage image, String documentName) throws DocumentException

Parameters

> `image` DocumentImage
> in The image that contains the document. Must be a realigned BGR image of the document.
> `documentName` String
> in The name of the document to be searched. Must be a key loaded in DocumentLibrary.

Returns

> TextFieldList
> A list of all the text fields read in the document.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

Swift

    public func readDocument(image: DocumentImage, documentName: String) throws -> TextFieldList

Parameters

> `image` DocumentImage
> in The image that contains the document. Must be a realigned BGR image of the document.
> `documentName` String
> in The name of the document to be searched. Must be a key loaded in DocumentLibrary.

Returns

> TextFieldList
> A list of all the text fields read in the document.

Exceptions

> DocumentException
> An error has occurred during Document Library execution.

C

    int id3DocumentReader_ReadDocument (
        ID3_DOCUMENT_READER hDocumentReader,
        ID3_DOCUMENT_IMAGE hImage,
        const char * documentName,
        ID3_DOCUMENT_TEXT_FIELD_LIST hReadTexts)

Parameters

> `hDocumentReader` ID3_DOCUMENT_READER
> in Handle to the DocumentReader object.
> `hImage` ID3_DOCUMENT_IMAGE
> in The image that contains the document. Must be a realigned BGR image of the document.
> `documentName` const char *
> in The name of the document to be searched. Must be a key loaded in DocumentLibrary.
> `hReadTexts` ID3_DOCUMENT_TEXT_FIELD_LIST
> out A list of all the text fields read in the document.

Returns

> `int`
> An error code.
> See id3DocumentError file for the list of possible error codes.