Custom Text Builder

Defined under the namespace Scandit.Datacapture.Label

CustomTextBuilder
class CustomTextBuilder : TextFieldBuilder<CustomTextBuilder, CustomText>

Added in version 7.2.0

Builder class for creating CustomText field definitions. Provides a fluent interface for configuring text field properties including validation regexes, location constraints, and OCR-specific settings.

constructor(name)
constructor(name?: string)

Added in version 8.3.0

Constructs a builder with the field name pre-set. When provided, build can be called without arguments.

setLocation(location)
setLocation(location: LabelFieldLocation): this

Added in version 7.2.0

setAnchorRegexes(anchorRegexes)
setAnchorRegexes(anchorRegexes: string[]): this

Added in version 8.0.0

Used to specify keywords or phrases that help identify the context of the field. This is particularly useful when the label contains multiple fields that could match the same regex (e.g., when both packaging and expiry dates are present).

setAnchorRegex(anchorRegex)
setAnchorRegex(anchorRegex: RegExp): this

Added in version 8.0.0

Used to specify keywords or phrases that help identify the context of the field. This is particularly useful when the label contains multiple fields that could match the same regex (e.g., when both packaging and expiry dates are present).

resetAnchorRegexes()
resetAnchorRegexes(): this

Added in version 8.2.0

This method can be used to remove the default anchorRegex, allowing you to rely solely on the valueRegexes for detection.

build(name)
build(name?: string): Promise<CustomText>

Added in version 7.2.0

Creates a CustomText field definition with the specified name and all configured properties.

customText(name)
function customText(name: string): CustomTextBuilder

Added in version 8.4.0

Creates a new CustomTextBuilder with the given field name pre-set. Shorthand for new CustomTextBuilder(name).