Custom Text

Defined in framework ScanditLabelCapture

CustomText
open class CustomText : TextField

Added in version 6.21.0

Defines a text field with customizable OCR recognition and validation regexes. This field type uses optical character recognition (OCR) to extract text content from labels and can apply regexes for content validation.

init
init(name: String)

Added in version 6.21.0

Builds a new instance of this class with the provided name.

field
open class func field(withName name: String) -> Self

Added in version 6.21.0

Builds a new instance of this class with the provided name.

setLocation
open func setLocation(rect: CGRect) -> Void

Added in version 6.21.0

Set the location of the text field using a rectangle.

setLocation
open func setLocation(left: CGFloat, top: CGFloat, right: CGFloat, bottom: CGFloat) -> Void

Added in version 6.21.0

Set the location of the text field using coordinates.

setLocation
open func setLocation(type location: LabelFieldLocationType) -> Void

Added in version 6.21.0

Set the location of the text field using a predefined location type.

anchorRegexes
open var anchorRegexes: Array<String>? { get, set }

Added in version 8.0.0

Context-identifying keywords or phrases used to distinguish between fields that may have similar patterns. These patterns help Smart Label Capture identify which field the captured data belongs to when multiple fields could match the same regex.

For example, when a label contains both expiry date and packing date fields, you can use anchorRegexes like [“exp”, “expiry”] for the expiry date field and [“pack”, “packing”] for the packing date field to help the system correctly identify which date is which.