Custom Barcode
Defined under the namespace Scandit.Datacapture.Label
- CustomBarcode
class CustomBarcode : BarcodeField
Added in version 7.2.0
Defines a barcode field with customizable symbology support and validation patterns. This field type allows you to specify which barcode symbologies should be recognized and optionally apply data validation patterns to the decoded content.
Use the builder pattern with CustomBarcodeBuilder for convenient configuration, or create instances directly using the various factory methods.
- dataTypePatterns
get dataTypePatterns(): string[]
Added in version 7.2.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 pattern.
For example, when a label contains both expiry date and packing date fields, you can use dataTypePatterns 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.
- patterns
get patterns(): string[]
Added in version 7.2.0
Regular expression patterns used to validate the decoded barcode content. These patterns allow you to ensure that the captured barcode data matches the expected format for your specific use case.
For example, you can use patterns like [“^[0-9]{12,13}$”] to ensure the barcode contains only 12-13 digits, or [“^[A-Z0-9]{17}$”] for VIN codes that must be exactly 17 alphanumeric characters.
- isOptional
get isOptional(): boolean
Added in version 7.2.0
Determines whether this field is required for the label to be considered complete. When set to true, the label can be marked as complete even if this field is not found. When false (mandatory), the label will only be complete when this field is successfully captured.
Optional fields are useful for scenarios where certain information might not always be present on labels, such as promotional codes or secondary identifiers.
- symbologies
get symbologies(): SymbologySettings[]
Added in version 7.2.0
The barcode symbologies (formats) that this field should recognize. This allows you to specify which types of barcodes are expected for this field, such as Code 128, EAN-13, or Data Matrix.
Restricting symbologies improves recognition accuracy and performance by focusing the scanner on the expected barcode formats for each field.
- location
get location(): LabelFieldLocation |
undefined
Added in version 7.2.0
The spatial location constraint for this barcode field within the label. This can be used to specify where on the label this field is expected to appear, helping to improve recognition accuracy and speed by focusing the search area.