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

# DocumentReader.readField Method

Module: DocumentReader

## Definition

Reads a single field in a document.

Python

    read_field(self, image: DocumentImage, document_name: str, field_name: str) -> TextField

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.
> `field_name` str
> in The name of the field to search.

Returns

> TextField
> Read Text in the specified field.

Exceptions

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

Dart

    TextField readField(DocumentImage image, String? documentName, String? fieldName)

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.
> `fieldName` String
> in The name of the field to search.

Returns

> TextField
> Read Text in the specified field.

Exceptions

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

C#

    public TextField ReadField(DocumentImage image, string documentName, string fieldName)

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.
> `fieldName` string
> in The name of the field to search.

Returns

> TextField
> Read Text in the specified field.

Exceptions

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

Java

    public TextField readField(DocumentImage image, String documentName, String fieldName) 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.
> `fieldName` String
> in The name of the field to search.

Returns

> TextField
> Read Text in the specified field.

Exceptions

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

Swift

    public func readField(image: DocumentImage, documentName: String, fieldName: String) throws -> TextField

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.
> `fieldName` String
> in The name of the field to search.

Returns

> TextField
> Read Text in the specified field.

Exceptions

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

C

    int id3DocumentReader_ReadField (
        ID3_DOCUMENT_READER hDocumentReader,
        ID3_DOCUMENT_IMAGE hImage,
        const char * documentName,
        const char * fieldName,
        ID3_DOCUMENT_TEXT_FIELD hReadText)

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.
> `fieldName` const char *
> in The name of the field to search.
> `hReadText` ID3_DOCUMENT_TEXT_FIELD
> out Read Text in the specified field.

Returns

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