Parser

Defined under the namespace Scandit.Datacapture.Parser

Parser
class Parser : DataCaptureComponent

Added in version 6.10.0

forContextAndFormat(context, dataFormat)
static forContextAndFormat(context: DataCaptureContext,
        dataFormat: ParserDataFormat): Promise<Parser>

Added in version 6.10.0

Create new parser for the provided data format and context. The license key with which the data capture context was constructed must have the parser feature enabled.

In case the parser could not be constructed, an exception is raised. Information on why creation failed is contained in the exception error message.

parseString(data)
parseString(data: string): Promise<ParsedData>

Added in version 6.10.0

Parses the data string and returns the contained field in the result object. Typical inputs to this method is the data contained in a barcode (see Barcode.data)

In case the data string could not be parsed, an exception is raised. More detailed information on why creation failed is contained in the exception error message.

parseRawData(data)
parseRawData(data: string): Promise<ParsedData>

Added in version 6.10.0

Parses the raw data and returns the contained field in the result object. Typical inputs to this method is the raw data of a barcode (see Barcode.rawData).

In case the data string could not be parsed, an exception is raised. More detailed information on why creation failed is contained in the exception error message.

setOptions(options)
setOptions(options: object<string, any>): Promise<void>

Added in version 6.10.0

Set the provided options on the parser.

Available options depend on the data format type of the parser and are documented for each of the supported data formats.

In case the options are invalid, an exception is raised. More detailed information on why creation failed is contained in the exception error message.

id
get id(): string

Added in version 6.10.0

Implemented from DataCaptureComponent. See DataCaptureComponent.id.

dispose()
dispose(): void

Added in version 6.22.0

Disposes the parser.