Label Capture Settings
Defined under the namespace Scandit.Datacapture.Label
- LabelCaptureSettings
class LabelCaptureSettingsAdded in version 7.2.0
Configures label capture parameters and defines the structure of labels to be captured. This settings object is central to the Smart Label Capture workflow, specifying which label definitions to use, recognition parameters, and capture behavior.
Key configuration aspects:
Label definitions - Defines field types (barcodes, dates, text) and their validation rules
Recognition parameters - Controls scanning behavior and accuracy
Location selection - Specifies scanning areas and constraints
Symbology settings - Configures which barcode types are enabled
The settings follow a fluent builder pattern for convenient configuration and support multiple label definitions to handle different types of labels in the same scanning session. For the settings to take effect, they must be applied to a label capture instance using the appropriate apply settings method. The same holds for settings already applied: changes made to them afterwards take effect only once the settings are applied again.
- fromLabelDefinitions(labelDefinitions)
static fromLabelDefinitions(labelDefinitions: LabelDefinition[]): Promise<LabelCaptureSettings>
Added in version 7.2.0
Load the settings from an array of LabelDefinition
- getLanguages()
getLanguages(): Promise<LabelCaptureLanguage[]>
Added in version 8.7.0
Gets the languages the prebuilt field definitions recognize. See setLanguages().
- setLanguages(languages)
setLanguages(languages: LabelCaptureLanguage[]): Promise<
void>Added in version 8.7.0
Sets the languages the prebuilt field definitions, such as ExpiryDateText or WeightText, recognize: the month names of their dates and the keywords that locate them on the label. Value or anchor regexes you set on a field replace the prebuilt ones and are used as given.
By default, the list is empty and the prebuilt field definitions keep their default recognition. A non-empty list restricts their language-specific patterns to the listed languages. List only the languages your labels use: every additional language widens the patterns and raises the chance of false positives.
Changing the languages doesn’t automatically apply them to LabelCapture. To change the languages of a running LabelCapture, call LabelCapture.applySettings() with these LabelCaptureSettings again.
The returned promise is rejected, leaving the settings unchanged, if the languages cannot be applied.
- getLocationSelection()
getLocationSelection(): Promise<LocationSelection |
undefined>Added in version 7.2.0
Gets the strategy with which to select one out of many visible labels. By default, this property is null and label selection is disabled.
Currently only RectangularLocationSelection is supported.
- setLocationSelection(locationSelection)
setLocationSelection(locationSelection: LocationSelection): Promise<
void>Added in version 7.2.0
Sets the strategy with which to select one out of many visible labels. By default, this property is null and label selection is disabled.
Currently only RectangularLocationSelection is supported.
- setProperty(key, value)
setProperty(key: string, value:
unknown): Promise<void>Added in version 7.2.0
Sets a property to the provided value. Use this method to set properties that are not yet part of a stable API. Properties set through this method may change in a future release.
- getProperty(key)
getProperty(key: string): Promise<
unknown>Added in version 7.2.0
Retrieves the value of a previously set property. In case the property does not exist, null is returned. Use this method to get properties that are not yet part of a stable API. These properties may change in a future release.
- settingsForSymbology(symbology)
settingsForSymbology(symbology: Symbology): Promise<LabelSymbologySettings>
Added in version 8.7.0
Gets SymbologySettings specific for the given Symbology.
Note that modifying the returned object doesn’t automatically apply the changes to LabelCapture. After you made changes to the symbology settings, call LabelCapture.applySettings() with these LabelCaptureSettings to apply them.