API reference
Every method, setting, enum and result of the barKoder Cordova SDK, grouped by what you do with it.
Scanning & session #
initialize #
initialize(width: number, height: number, x: number, y: number)
Initializes the Barkoder scanner with the specified dimensions and position.
Parameters:
| Parameter | Type | Description |
|---|---|---|
width | number | The width of the scanner view |
height | number | The height of the scanner view |
x | number | The X position of the scanner view |
y | number | The Y position of the scanner view |
registerWithLicenseKey #
registerWithLicenseKey(licenseKey: string)
Registers the Barkoder scanner with the specified license key.
Parameters:
| Parameter | Type | Description |
|---|---|---|
licenseKey | string | The license key to register the Barkoder scanner |
startScanning #
startScanning(success: (data: any) => void, error: (err: any) => void)
Initiates the barcode scanning process, allowing the application to detect and decode barcodes from the device's camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
success | (data: any) => void | Receives a raw scan result. See Scan Callbacks for conversion to BarkoderResult. |
error | (err: any) => void | Handles scanning errors reported by the plugin. |
stopScanning #
stopScanning()
Halts the barcode scanning process, stopping the camera from capturing and processing barcode information.
pauseScanning #
pauseScanning()
Temporarily suspends the barcode scanning process, pausing the camera feed without completely stopping the scanning session.
freezeScanning #
freezeScanning()
Freezes the current AR scanning session by capturing a still image from the camera feed. Use only when AR mode is enabled to temporarily freeze the view while keeping overlays visible.
unfreezeScanning #
unfreezeScanning()
Unfreezes the AR scanning session by removing the still image and reactivating the camera and overlays. Use only when AR mode is enabled to restore the live AR view and continue scanning.
setThreadsLimit #
setThreadsLimit(threadsLimit: number)
Sets the threads limit for decoding operations.
Parameters:
| Parameter | Type | Description |
|---|---|---|
threadsLimit | number | The maximum number of threads to use for decoding |
getThreadsLimit #
getThreadsLimit()
Retrieves the threads limit.
setDecodingSpeed #
setDecodingSpeed(decodingSpeed: number)
Sets the decoding speed for barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
decodingSpeed | number | The decoding speed to set for the barcode scanner |
getDecodingSpeed #
getDecodingSpeed()
Retrieves the current decoding speed setting for barcode scanning.
setMatchFilter #
setMatchFilter(value: string)
Sets a string or regular expression used to match decoded barcode data.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | string | The string or regular expression used to match decoded barcode data |
getMatchFilter #
getMatchFilter()
Retrieves the string or regular expression used to match decoded barcode data.
setUPCEexpandToUPCA #
setUPCEexpandToUPCA(enabled: boolean)
Sets whether the UPC-E barcodes should be expanded to UPC-A format.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | A boolean indicating whether to enable the expansion for UPC-E barcodes |
setUPCE1expandToUPCA #
setUPCE1expandToUPCA(enabled: boolean)
Sets whether the UPC-E1 barcodes should be expanded to UPC-A format.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | A boolean indicating whether to enable the expansion for UPC-E1 barcodes |
setDynamicExposure #
setDynamicExposure(intensity: number)
Sets the camera's exposure dynamically based on the provided intensity, cycling through predefined compensation values.
Parameters:
| Parameter | Type | Description |
|---|---|---|
intensity | number | The integer value for the exposure intensity |
setVideoStabilization #
setVideoStabilization(value: boolean)
Enables or disables video stabilization for smoother video capture.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | A boolean indicating whether video stabilization should be enabled/disabled |
configureBarkoder #
configureBarkoder(barkoderConfig: object)
Configures the Barkoder functionality based on the provided configuration.
Parameters:
| Parameter | Type | Description |
|---|---|---|
barkoderConfig | object | The configuration object for Barkoder scanner |
setPowerSavingMode #
setPowerSavingMode(powerSavingMode: number)
Power saving mode level. Higher values reduce CPU/battery usage by limiting frame processing.
Default value is 0. 0 - Disabled (full performance) 1 - Light saving 2 - Medium saving 3 - High saving 4 - Maximum saving
Parameters:
| Parameter | Type | Description |
|---|---|---|
powerSavingMode | number | The power saving mode level to set. |
getPowerSavingMode #
getPowerSavingMode()
Retrieves the power saving mode level.
selectVisibleBarcodes #
selectVisibleBarcodes()
Selects all barcodes that are currently visible in AR mode.
getVersion #
getVersion()
Retrieves the version of the Barkoder SDK.
getLibVersion #
getLibVersion()
Retrieves the version of the Barkoder library.
getDeviceId #
getDeviceId()
Retrieves the Device ID.
Camera #
startCamera #
startCamera()
Starts the camera for barcode scanning preparation.
setZoomFactor #
setZoomFactor(zoomFactor: number)
Sets the zoom factor for the device's camera, adjusting the level of zoom during barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
zoomFactor | number | The zoom factor to set. This should be a positive number |
getCurrentZoomFactor #
getCurrentZoomFactor()
Retrieves the current zoom factor for the device's camera.
getMaxZoomFactor #
getMaxZoomFactor()
Retrieves the maximum available zoom factor for the device's camera.
setFlashEnabled #
setFlashEnabled(enabled: boolean)
Enables or disables the device's flash (torch) for illumination during barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable the flash, false to disable it |
isFlashAvailable #
isFlashAvailable()
Checks whether the device has a built-in flash (torch) that can be used for illumination during barcode scanning.
setLocationInPreviewEnabled #
setLocationInPreviewEnabled(enabled: boolean)
Enables or disables the display of barcode location information on the camera preview.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to display location information in the scanning preview, false to hide it |
isLocationInPreviewEnabled #
isLocationInPreviewEnabled()
Checks if location in preview is enabled.
setPinchToZoomEnabled #
setPinchToZoomEnabled(enabled: boolean)
Enables or disables the pinch-to-zoom feature for adjusting the zoom level during barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable pinch-to-zoom gesture, false to disable it |
isPinchToZoomEnabled #
isPinchToZoomEnabled()
Checks if pinch to zoom is enabled.
setBarkoderResolution #
setBarkoderResolution(resolution: number)
Sets the resolution for barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
resolution | number | The resolution to set for the barcode scanner |
getBarkoderResolution #
getBarkoderResolution()
Retrieves the resolution for barcode scanning.
setCentricFocusAndExposure #
setCentricFocusAndExposure(value: boolean)
Sets the camera to use the center of the viewfinder for focus and exposure.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | A boolean indicating whether the center of the viewfinder should be used |
setCamera #
setCamera(value: number)
Sets the camera to be used for scanning (back/front).
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | The value which camera should be used |
setPreviewMirrored #
setPreviewMirrored(value: boolean)
Controls whether the front camera preview is horizontally mirrored.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | Set to true to mirror the preview, false to disable mirroring |
isPreviewMirrored #
isPreviewMirrored()
Retrieves whether the front camera preview is horizontally mirrored.
Barcode types #
setBarcodeTypeEnabled #
setBarcodeTypeEnabled(type: number, enabled: boolean)
Sets whether a specific barcode type is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
type | number | The barcode type to enable or disable |
enabled | boolean | Set to true to enable the barcode type, false to disable it |
isBarcodeTypeEnabled #
isBarcodeTypeEnabled(type: number)
Checks if a specific barcode type is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
type | number | The barcode type to check |
setBarcodeTypeLengthRange #
setBarcodeTypeLengthRange(type: number, min: number, max: number)
Sets the length range for the specified barcode type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
type | number | The barcode type to configure |
min | number | The minimum length |
max | number | The maximum length |
getBarcodeTypeLengthRange #
getBarcodeTypeLengthRange(type: number)
Retrieves the length range of a specific barcode type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
type | number | The barcode type to check |
setEncodingCharacterSet #
setEncodingCharacterSet(characterSet: string)
Sets the encoding character set for barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
characterSet | string | The character set to use for encoding data |
getEncodingCharacterSet #
getEncodingCharacterSet()
Retrieves the character set used for encoding barcode data.
setFormattingType #
setFormattingType(formattingType: number)
Sets the formatting type for barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
formattingType | number | The formatting type to set for the barcode scanner |
getFormattingType #
getFormattingType()
Retrieves the formatting type used for presenting decoded barcode data.
setCode11ChecksumType #
setCode11ChecksumType(checksumType: number)
Sets the Code11 checksum type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
checksumType | number | The checksum type to set for Code 11 barcodes |
getCode11ChecksumType #
getCode11ChecksumType()
Retrieves the Code11 checksum type.
setMsiChecksumType #
setMsiChecksumType(checksumType: number)
Sets the MSI checksum type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
checksumType | number | The checksum type to set for the MSI barcode scanner |
getMsiChecksumType #
getMsiChecksumType()
Retrieves the MSI checksum type.
setCode39ChecksumType #
setCode39ChecksumType(checksumType: number)
Sets the Code39 checksum type.
Parameters:
| Parameter | Type | Description |
|---|---|---|
checksumType | number | The checksum type to set for Code 39 barcodes |
getCode39ChecksumType #
getCode39ChecksumType()
Retrieves the checksum type for Code 39 barcodes.
setUpcEanDeblurEnabled #
setUpcEanDeblurEnabled(enabled: boolean)
Sets whether the deblurring feature for UPC/EAN barcodes is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable UPC/EAN deblur, false to disable it |
isUpcEanDeblurEnabled #
isUpcEanDeblurEnabled()
Retrieves the value indicating whether deblurring is enabled for UPC/EAN barcodes.
setMisshaped1DEnabled #
setMisshaped1DEnabled(enabled: boolean)
Sets whether the detection of misshaped 1D barcodes is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable detection of misshaped 1D barcodes, false to disable it |
isMisshaped1DEnabled #
isMisshaped1DEnabled()
Checks if the detection of misshaped 1D barcodes is enabled.
setEnableVINRestrictions #
setEnableVINRestrictions(enableVINRestrictions: boolean)
Sets whether Vehicle Identification Number (VIN) restrictions are enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enableVINRestrictions | boolean | Set to true to enable VIN restrictions, false to disable them |
isVINRestrictionsEnabled #
isVINRestrictionsEnabled()
Checks if VIN restrictions are enabled.
setDatamatrixDpmModeEnabled #
setDatamatrixDpmModeEnabled(enabled: boolean)
Sets whether the Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable Data Matrix DPM mode, false to disable it |
isDatamatrixDpmModeEnabled #
isDatamatrixDpmModeEnabled()
Retrieves whether Direct Part Marking (DPM) mode for Datamatrix barcodes is enabled.
setQrDpmModeEnabled #
setQrDpmModeEnabled(enabled: boolean)
Sets whether the Direct Part Marking (DPM) mode for QR barcodes is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable QR DPM mode, false to disable it |
isQrDpmModeEnabled #
isQrDpmModeEnabled()
Retrieves whether Direct Part Marking (DPM) mode for QR barcodes is enabled.
setQrMicroDpmModeEnabled #
setQrMicroDpmModeEnabled(enabled: boolean)
Sets whether the Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable QR Micro DPM mode, false to disable it |
isQrMicroDpmModeEnabled #
isQrMicroDpmModeEnabled()
Retrieves whether Direct Part Marking (DPM) mode for QR Micro barcodes is enabled.
setQrMultiPartMergeEnabled #
setQrMultiPartMergeEnabled(enabled: boolean)
Sets whether the QR multi-part merge is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable QR multi-part merge, false to disable it |
isQrMultiPartMergeEnabled #
isQrMultiPartMergeEnabled()
Retrieves whether QR multi-part merge is enabled.
setIdDocumentMasterChecksumEnabled #
setIdDocumentMasterChecksumEnabled(enabled: boolean)
Sets whether Master checksum should be required when scanning ID Documents.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable Master checksum, false to disable it |
isIdDocumentMasterChecksumEnabled #
isIdDocumentMasterChecksumEnabled()
Retrieves whether Master checksum is enabled when scanning ID Documents.
setCustomOption #
setCustomOption(option: string, value: number)
Sets a custom option.
See more details about available options and their values.
Parameters:
| Parameter | Type | Description |
|---|---|---|
option | string | The string value for the custom option |
value | number | The integer value for the custom option |
setCustomOptionGlobal #
setCustomOptionGlobal(option: string, value: number)
Sets a custom option globally (must be called before initialize(), which creates the native configuration).
Parameters:
| Parameter | Type | Description |
|---|---|---|
option | string | The string key for the custom option |
value | number | The integer value for the custom option |
setEnableComposite #
setEnableComposite(value: number)
Sets whether Composite Mode should be enabled when scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | The integer value if composite mode should be enabled |
Results #
captureImage #
captureImage()
Captures the latest camera frame.
scanImage #
scanImage(base64: string, success: (data: any) => void, error: (err: any) => void)
Scan barcodes from a base64 string image.
Parameters:
| Parameter | Type | Description |
|---|---|---|
base64 | string | Base64 encoded image string without a data URL prefix. |
success | (data: any) => void | Receives a raw scan result. See Scan Callbacks for conversion to BarkoderResult. |
error | (err: any) => void | Handles errors reported by the plugin; invalid image input may not invoke this callback. |
setCloseSessionOnResultEnabled #
setCloseSessionOnResultEnabled(enabled: boolean)
Enables or disables the automatic closing of the scanning session upon detecting a barcode result.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable automatic session closure, false to disable it |
isCloseSessionOnResultEnabled #
isCloseSessionOnResultEnabled()
Checks if the automatic closing of the scanning session upon detection is enabled.
setImageResultEnabled #
setImageResultEnabled(enabled: boolean)
Enables or disables the capturing and processing of image data when a barcode is successfully detected.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to include an image in the result, false to exclude it |
isImageResultEnabled #
isImageResultEnabled()
Checks if the capturing and processing of image data when a barcode is successfully detected is enabled.
setBeepOnSuccessEnabled #
setBeepOnSuccessEnabled(enabled: boolean)
Enables or disables the audible beep sound upon successfully decoding a barcode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable the beep sound, false to disable it |
isBeepOnSuccessEnabled #
isBeepOnSuccessEnabled()
Retrieves the value indicating whether a beep sound is played on successful barcode scanning.
setVibrateOnSuccessEnabled #
setVibrateOnSuccessEnabled(enabled: boolean)
Enables or disables the device vibration upon successfully decoding a barcode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable vibration, false to disable it |
isVibrateOnSuccessEnabled #
isVibrateOnSuccessEnabled()
Retrieves the value indicating whether vibration is enabled on successful barcode scanning.
setReturnOnlyMatchedResults #
setReturnOnlyMatchedResults(value: boolean)
Controls whether only results matching the configured match filter are returned.
If false, all decoded results are returned, including unmatched results.
This option only applies when a match filter is active.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | Set to true to return only matched results, false to return all decoded results |
getReturnOnlyMatchedResults #
getReturnOnlyMatchedResults()
Retrieves whether only results matching the configured match filter are returned.
setMulticodeCachingEnabled #
setMulticodeCachingEnabled(enabled: boolean)
Sets whether multi-code caching is enabled.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to enable multi-code caching, false to disable it |
getMulticodeCachingEnabled #
getMulticodeCachingEnabled()
Retrieves whether multi-code caching is enabled.
setMulticodeCachingDuration #
setMulticodeCachingDuration(duration: number)
Sets the caching duration (in milliseconds) for multi-code results.
Parameters:
| Parameter | Type | Description |
|---|---|---|
duration | number | The caching duration in milliseconds for multi-code barcode scanning |
getMulticodeCachingDuration #
getMulticodeCachingDuration()
Retrieves the caching duration (in milliseconds) for multi-code results.
setMaximumResultsCount #
setMaximumResultsCount(resultsCount: number)
Sets the maximum number of results to be returned from barcode scanning.
Parameters:
| Parameter | Type | Description |
|---|---|---|
resultsCount | number | The maximum number of results to return |
getMaximumResultsCount #
getMaximumResultsCount()
Retrieves the maximum number of results to be returned from barcode scanning at once.
setThresholdBetweenDuplicatesScans #
setThresholdBetweenDuplicatesScans(thresholdBetweenDuplicatesScans: number)
Sets the threshold between duplicate scans.
Parameters:
| Parameter | Type | Description |
|---|---|---|
thresholdBetweenDuplicatesScans | number | The threshold between duplicate scans |
getThresholdBetweenDuplicatesScans #
getThresholdBetweenDuplicatesScans()
Retrieves the threshold between duplicate scans.
setBarcodeThumbnailOnResultEnabled #
setBarcodeThumbnailOnResultEnabled(enabled: boolean)
Enables or disables the barcode thumbnail on result.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to include the barcode thumbnail in the result, false to exclude it |
isBarcodeThumbnailOnResultEnabled #
isBarcodeThumbnailOnResultEnabled()
Checks if the barcode thumbnail on result is enabled.
setShowDuplicatesLocations #
setShowDuplicatesLocations(value: boolean)
Enables or disables showing duplicate barcode locations on the preview overlay.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | A boolean indicating whether to show duplicate locations |
getShowDuplicatesLocations #
getShowDuplicatesLocations()
Retrieves whether showing duplicate barcode locations in the AR view is enabled.
Region & overlay #
setLocationLineColor #
setLocationLineColor(hexColor: string)
Sets the color of the lines used to indicate the location of detected barcodes on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
hexColor | string | The color to set for the location lines, specified in hexadecimal format (e.g., '#FF0000' for red) |
getLocationLineColorHex #
getLocationLineColorHex()
Retrieves the hexadecimal color code representing the line color used to indicate the location of detected barcodes.
setLocationLineWidth #
setLocationLineWidth(lineWidth: number)
Sets the width of the lines indicating the location of detected barcodes on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
lineWidth | number | The width of the location lines, in pixels. Must be a positive number |
getLocationLineWidth #
getLocationLineWidth()
Retrieves the current width setting for the lines indicating the location of detected barcodes on the camera feed.
setRoiLineColor #
setRoiLineColor(hexColor: string)
Sets the color of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
hexColor | string | The color to set for the ROI lines, in hexadecimal format (e.g., '#FF0000' for red) |
getRoiLineColorHex #
getRoiLineColorHex()
Retrieves the hexadecimal color code representing the line color of the Region of Interest (ROI) on the camera preview.
setRoiLineWidth #
setRoiLineWidth(lineWidth: number)
Sets the width of the lines outlining the Region of Interest (ROI) for barcode scanning on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
lineWidth | number | The width of the ROI lines, in pixels. This should be a positive number |
getRoiLineWidth #
getRoiLineWidth()
Retrieves the current width setting for the lines outlining the Region of Interest (ROI) on the camera preview.
setRoiOverlayBackgroundColor #
setRoiOverlayBackgroundColor(hexColor: string)
Sets the background color of the overlay within the Region of Interest (ROI) for barcode scanning on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
hexColor | string | The background color to set for the ROI overlay, in hexadecimal format (e.g., '#FF0000' for red) |
getRoiOverlayBackgroundColorHex #
getRoiOverlayBackgroundColorHex()
Retrieves the hexadecimal color code representing the background color of the overlay within the Region of Interest (ROI) on the camera preview.
setRegionOfInterest #
setRegionOfInterest(left: number, top: number, width: number, height: number)
Defines the Region of Interest (ROI) on the camera preview for barcode scanning, specifying an area where the application focuses on detecting barcodes.
Parameters:
| Parameter | Type | Description |
|---|---|---|
left | number | The left position of the ROI |
top | number | The top position of the ROI |
width | number | The width of the ROI |
height | number | The height of the ROI |
getRegionOfInterest #
getRegionOfInterest()
Retrieves the region of interest (ROI) configuration.
setRegionOfInterestVisible #
setRegionOfInterestVisible(regionOfInterestVisible: boolean)
Sets the visibility of the Region of Interest (ROI) on the camera preview.
Parameters:
| Parameter | Type | Description |
|---|---|---|
regionOfInterestVisible | boolean | Set to true to make the region of interest visible, false to hide it |
isRegionOfInterestVisible #
isRegionOfInterestVisible()
Checks if the region of interest (ROI) is visible.
setRoiCenterMark #
setRoiCenterMark(value: number)
Sets the visual marker displayed at the center of the Region of Interest (ROI).
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | The ROI center mark style to set |
getRoiCenterMark #
getRoiCenterMark()
Retrieves the visual marker displayed at the center of the Region of Interest (ROI).
setScanningIndicatorColor #
setScanningIndicatorColor(hexColor: string)
Sets the color of the lines outlining the scanning indicator for barcode scanning on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
hexColor | string | The hexadecimal representation of the color |
getScanningIndicatorColorHex #
getScanningIndicatorColorHex()
Retrieves the hexadecimal color code representing the line color of the scanning indicator on the camera preview.
setScanningIndicatorWidth #
setScanningIndicatorWidth(lineWidth: number)
Sets the width of the scanning indicator for barcode scanning on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
lineWidth | number | The width of the scanning indicator to set |
getScanningIndicatorWidth #
getScanningIndicatorWidth()
Retrieves the current width setting for the scanning indicator on the camera preview.
setScanningIndicatorAnimation #
setScanningIndicatorAnimation(animation: number)
Sets the animation of the scanning indicator for barcode scanning on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
animation | number | The animation of the scanning indicator to set |
getScanningIndicatorAnimation #
getScanningIndicatorAnimation()
Retrieves the current animation setting for the scanning indicator on the camera preview.
setScanningIndicatorAlwaysVisible #
setScanningIndicatorAlwaysVisible(value: boolean)
Sets the scanning indicator to be always shown on the camera feed.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | A boolean indicating whether the scanning indicator should always remain visible |
isScanningIndicatorAlwaysVisible #
isScanningIndicatorAlwaysVisible()
Retrieves whether the scanning indicator is always visible on the camera preview.
setLocationInImageResultEnabled #
setLocationInImageResultEnabled(enabled: boolean)
Enables or disables the inclusion of barcode location information within the image data result.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Set to true to include location information in the image result, false to exclude it |
isLocationInImageResultEnabled #
isLocationInImageResultEnabled()
Checks if the inclusion of barcode location information within the image data result is enabled.
AR mode #
setARMode #
setARMode(value: number)
Sets the AR mode used for barcode scanning visualization.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | The AR mode (e.g., interactive, non-interactive, match filter or off) |
getARMode #
getARMode()
Retrieves the current AR mode used for barcode scanning.
setARReturnOnlyMatchedResults #
setARReturnOnlyMatchedResults(value: boolean)
Controls whether only matched results are returned in AR match filter mode.
If false, all detected results are returned, while unmatched results have isMatched set to false.
This option only applies when AR mode is matchFilter and a match filter is active.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | Set to true to return only matched results, false to return all detected results |
getARReturnOnlyMatchedResults #
getARReturnOnlyMatchedResults()
Retrieves whether only matched results are returned in AR match filter mode.
setARDisplayOnlyMatchedResults #
setARDisplayOnlyMatchedResults(value: boolean)
Controls whether only matched results are displayed in AR match filter mode.
If false, all decoded results are displayed, including unmatched results.
This option only applies when AR mode is matchFilter and a match filter is active.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | Set to true to display only matched results, false to display all decoded results |
getARDisplayOnlyMatchedResults #
getARDisplayOnlyMatchedResults()
Retrieves whether only matched results are displayed in AR match filter mode.
setARResultDisappearanceDelayMs #
setARResultDisappearanceDelayMs(value: number)
Sets the delay after which a detected AR result is considered expired.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Delay in milliseconds |
getARResultDisappearanceDelayMs #
getARResultDisappearanceDelayMs()
Retrieves the delay after which AR results disappear once detected.
setARLocationTransitionSpeed #
setARLocationTransitionSpeed(value: number)
Sets the speed of overlay transition for AR barcode locations.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Transition speed value |
getARLocationTransitionSpeed #
getARLocationTransitionSpeed()
Retrieves the transition speed for AR barcode location overlays.
setAROverlayRefresh #
setAROverlayRefresh(value: number)
Sets the refresh mode for the AR overlay.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Refresh mode value |
getAROverlayRefresh #
getAROverlayRefresh()
Retrieves the AR overlay refresh mode.
setARSelectedLocationColor #
setARSelectedLocationColor(value: string)
Sets the overlay color for selected barcodes in AR mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | string | Hex color code |
getARSelectedLocationColor #
getARSelectedLocationColor()
Retrieves the color used for selected barcode overlays in AR mode.
setARNonSelectedLocationColor #
setARNonSelectedLocationColor(value: string)
Sets the overlay color for non-selected barcodes in AR mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | string | Hex color code |
getARNonSelectedLocationColor #
getARNonSelectedLocationColor()
Retrieves the color used for non-selected barcode overlays in AR mode.
setARSelectedLocationLineWidth #
setARSelectedLocationLineWidth(value: number)
Sets line width for selected barcode overlay.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Width in pixels |
getARSelectedLocationLineWidth #
getARSelectedLocationLineWidth()
Retrieves the line width for selected barcode overlays in AR mode.
setARNonSelectedLocationLineWidth #
setARNonSelectedLocationLineWidth(value: number)
Sets line width for non-selected barcode overlay.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Width in pixels |
getARNonSelectedLocationLineWidth #
getARNonSelectedLocationLineWidth()
Retrieves the line width for non-selected barcode overlays in AR mode.
setARLocationType #
setARLocationType(value: number)
Sets AR location style (tight, bounding box, none).
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Location type |
getARLocationType #
getARLocationType()
Retrieves the style of AR location overlays (tight, bounding box, none).
setARDoubleTapToFreezeEnabled #
setARDoubleTapToFreezeEnabled(enabled: boolean)
Enables or disables double-tap to freeze scanning in AR mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Boolean toggle |
isARDoubleTapToFreezeEnabled #
isARDoubleTapToFreezeEnabled()
Checks whether double-tap to freeze is enabled in AR mode.
setARImageResultEnabled #
setARImageResultEnabled(enabled: boolean)
Enables or disables the capturing and processing of image data when a barcode is selected for AR mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Boolean toggle |
isARImageResultEnabled #
isARImageResultEnabled()
Retrieves whether image result is enabled for AR mode.
setARBarcodeThumbnailOnResultEnabled #
setARBarcodeThumbnailOnResultEnabled(enabled: boolean)
Enables or disables the barcode thumbnail on result for AR mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
enabled | boolean | Boolean toggle |
isARBarcodeThumbnailOnResultEnabled #
isARBarcodeThumbnailOnResultEnabled()
Retrieves whether barcode thumbnail on result is enabled for AR mode.
setARResultLimit #
setARResultLimit(value: number)
Sets the maximum number of results allowed in a single AR scanning session.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Maximum results limit |
getARResultLimit #
getARResultLimit()
Retrieves the maximum number of results allowed in a single AR scanning session.
setARContinueScanningOnLimit #
setARContinueScanningOnLimit(value: boolean)
Sets whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | Boolean toggle |
getARContinueScanningOnLimit #
getARContinueScanningOnLimit()
Retrieves whether scanning continues when the result limit is reached (only in .interactiveDisabled mode).
setAREmitResultsAtSessionEndOnly #
setAREmitResultsAtSessionEndOnly(value: boolean)
Sets whether results are emitted only at AR session end (or when the limit is reached).
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | boolean | Boolean toggle |
getAREmitResultsAtSessionEndOnly #
getAREmitResultsAtSessionEndOnly()
Retrieves whether results are emitted only at AR session end (or when the limit is reached).
setARHeaderHeight #
setARHeaderHeight(value: number)
Sets height of header label above barcode in AR mode.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Height in pixels |
getARHeaderHeight #
getARHeaderHeight()
Retrieves the header height above barcode in AR mode.
setARHeaderShowMode #
setARHeaderShowMode(value: number)
Sets header visibility condition (always, on selected, never).
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Show mode |
getARHeaderShowMode #
getARHeaderShowMode()
Retrieves the header display mode (always, on selected, never).
setARHeaderMaxTextHeight #
setARHeaderMaxTextHeight(value: number)
Sets max text height for AR header.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Max height in pixels |
getARHeaderMaxTextHeight #
getARHeaderMaxTextHeight()
Retrieves the maximum text height for AR headers.
setARHeaderMinTextHeight #
setARHeaderMinTextHeight(value: number)
Sets min text height for AR header.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Min height in pixels |
getARHeaderMinTextHeight #
getARHeaderMinTextHeight()
Retrieves the minimum text height for AR headers.
setARHeaderTextColorSelected #
setARHeaderTextColorSelected(value: string)
Sets text color for selected barcode header.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | string | Hex color code |
getARHeaderTextColorSelected #
getARHeaderTextColorSelected()
Retrieves the header text color for selected barcodes.
setARHeaderTextColorNonSelected #
setARHeaderTextColorNonSelected(value: string)
Sets text color for non-selected barcode header.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | string | Hex color code |
getARHeaderTextColorNonSelected #
getARHeaderTextColorNonSelected()
Retrieves the header text color for non-selected barcodes.
setARHeaderHorizontalTextMargin #
setARHeaderHorizontalTextMargin(value: number)
Sets the horizontal margin applied to the header text in AR mode, creating equal padding on both sides.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Margin in pixels |
getARHeaderHorizontalTextMargin #
getARHeaderHorizontalTextMargin()
Retrieves the horizontal margin for AR header text.
setARHeaderVerticalTextMargin #
setARHeaderVerticalTextMargin(value: number)
Sets the vertical margin applied to the header text in AR mode, creating equal padding on both sides.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | number | Margin in pixels |
getARHeaderVerticalTextMargin #
getARHeaderVerticalTextMargin()
Retrieves the vertical margin for AR header text.
setARHeaderTextFormat #
setARHeaderTextFormat(value: string)
Sets AR header text format using placeholders.
Parameters:
| Parameter | Type | Description |
|---|---|---|
value | string | Format string (e.g., \[barcode\_text\]) |
getARHeaderTextFormat #
getARHeaderTextFormat()
Retrieves the format string used for AR header text.
resetARCache #
resetARCache()
Clears all cached barcode results from the current AR scanning session.
On-screen buttons #
configureCloseButton #
configureCloseButton( visible: boolean, positionX: number, positionY: number, iconSize: number, tintColor: string, backgroundColor: string, cornerRadius: number, padding: number, useCustomIcon: boolean, customIcon: string )
Configures the close button displayed during scanning.
To perform an action when the button is tapped, listen for the barkoderCloseButtonTappedEvent
Parameters:
| Parameter | Type | Description |
|---|---|---|
visible | boolean | Show the button while scanning |
positionX | number | X position in points |
positionY | number | Y position in points |
iconSize | number | Glyph point size |
tintColor | string | Icon tint. Hex string (e.g., "#3472c9"). Leave empty to use default |
backgroundColor | string | Button background. Hex string. Leave empty to use default |
cornerRadius | number | Corner radius |
padding | number | Inner padding around the glyph |
useCustomIcon | boolean | Set true to use a provided custom icon |
customIcon | string | Custom icon for the button as a Base64-encoded image string |
configureFlashButton #
configureFlashButton( visible: boolean, positionX: number, positionY: number, iconSize: number, tintColor: string, backgroundColor: string, cornerRadius: number, padding: number, useCustomIcon: boolean, customIconFlashOn: string, customIconFlashOff: string )
Configures the flash (torch) button. Auto-hides if torch is unavailable.
Parameters:
| Parameter | Type | Description |
|---|---|---|
visible | boolean | Show the button while scanning |
positionX | number | X position in points |
positionY | number | Y position in points |
iconSize | number | Glyph point size |
tintColor | string | Icon tint. Hex string (e.g., "#3472c9"). Leave empty to use default |
backgroundColor | string | Button background. Hex string. Leave empty to use default |
cornerRadius | number | Corner radius |
padding | number | Inner padding around the glyph |
useCustomIcon | boolean | Set true to use provided custom icons |
customIconFlashOn | string | Custom icon for the ON state as a Base64-encoded image string |
customIconFlashOff | string | Custom icon for the OFF state as a Base64-encoded image string |
configureZoomButton #
configureZoomButton( visible: boolean, positionX: number, positionY: number, iconSize: number, tintColor: string, backgroundColor: string, cornerRadius: number, padding: number, useCustomIcon: boolean, customIconZoomedIn: string, customIconZoomedOut: string, zoomedInFactor: number, zoomedOutFactor: number )
Configures the zoom button.
Parameters:
| Parameter | Type | Description |
|---|---|---|
visible | boolean | Show the button while scanning |
positionX | number | X position in points |
positionY | number | Y position in points |
iconSize | number | Glyph point size |
tintColor | string | Icon tint. Hex string (e.g., "#3472c9"). Leave empty to use default |
backgroundColor | string | Button background. Hex string. Leave empty to use default |
cornerRadius | number | Corner radius |
padding | number | Inner padding around the glyph |
useCustomIcon | boolean | Set true to use provided custom icons |
customIconZoomedIn | string | Custom icon for the zoomed-in state as a Base64-encoded image string |
customIconZoomedOut | string | Custom icon for the zoomed-out state as a Base64-encoded image string |
zoomedInFactor | number | Zoom factor when toggled in |
zoomedOutFactor | number | Zoom factor when toggled out |
Result models #
Scan callbacks return plain objects. Use new BarkoderResult(data) to create the result models below. ? marks an optional property; its fallback value is listed where applicable.
Raw Scan Result #
The object received by the startScanning or scanImage success callback. Images contain JPEG Base64 without a data URL prefix.
| Property | Type | Description |
|---|---|---|
decoderResults | raw decoder result array | Decoded barcodes; may be empty. |
resultThumbnailsAsBase64? | Array of string or null | Available barcode thumbnails. May be empty or contain null entries. A matching index for each decoder result is not guaranteed. |
resultImageAsBase64? | string | Result image, when available. |
Raw Decoder Result #
| Property | Type | Description |
|---|---|---|
barcodeType | number | Native barcode-type identifier. |
barcodeTypeName? | string or null | Barcode-type name, when available. |
binaryDataAsBase64? | string | Barcode bytes encoded as Base64, not an image. |
textualData? | string or null | Decoded barcode text, when available. |
characterSet? | string or null | Character encoding, when available. |
extra? | string | Additional decoded data as JSON text. |
isMatched | boolean | Match status for the configured match filter. |
mrzImagesAsBase64? | Array of { name: string; base64?: string } | Available images for MRZ results. May be empty; image names and encoded content are not guaranteed. |
sadlImageAsBase64? | string | SADL image extracted from extra data, when available. |
locationPoints? | { x: number; y: number }[] | Available barcode location points. Coordinates are forwarded unchanged; point count and order are not guaranteed. |
BarkoderResult #
new BarkoderResult(resultMap: Record<string, any>)
Wraps the callback data and creates a DecoderResult for each decoded barcode.
| Property | Type | Description |
|---|---|---|
decoderResults | DecoderResult[] | Decoded barcodes. Defaults to [] if the input is not an array. |
resultThumbnailsAsBase64? | string[] or null | JPEG data URLs, with empty or null entries removed. An empty array remains []; missing or non-array input becomes null. |
resultImageAsBase64? | string or null | JPEG data URL, or null when missing or empty. |
Image values are prefixed with data:image/jpeg;base64,. Construct this model from raw callback data only; existing prefixes are not detected.
DecoderResult #
new DecoderResult(resultMap: Record<string, any>)
| Property | Type | Description |
|---|---|---|
barcodeType | number | Native barcode-type identifier; not declared as the BarcodeType enum. |
barcodeTypeName | string | Barcode-type name. |
binaryDataAsBase64 | string | Barcode bytes as Base64, unchanged. |
textualData | string | Decoded barcode text. |
characterSet? | string or null | Character encoding, or null when missing or empty. |
extra? | Record<string, any> or null | Parsed JSON data, or null when absent. Invalid JSON throws during construction; the parsed shape is not validated. |
mrzImagesAsBase64? | { name: string; base64: string }[] | Named MRZ images with JPEG data URLs. Defaults to [] if the input is missing or not an array. Image content is not validated. |
sadlImageAsBase64? | string or null | SADL image as a JPEG data URL, or null when missing or empty. |
locationPoints? | { x: number; y: number }[] | Original location-point array, or undefined when unavailable. |
isMatched | boolean | Match status from the decoded result. |
The types above are the helper's declared types. Directly copied fields have no fallback: missing values remain undefined, and null values remain null. MRZ image entries are not filtered; a missing or null encoding produces a data URL ending in undefined or null.
Location Point Shape #
Each entry in locationPoints has these properties:
| Property | Type | Description |
|---|---|---|
x | number | Horizontal coordinate. |
y | number | Vertical coordinate. |
MRZ Image Shape #
Each image in the DecoderResult.mrzImagesAsBase64 array has these properties:
| Property | Type | Description |
|---|---|---|
name | string | Image name. |
base64 | string | JPEG data URL. Raw callback entries contain bare Base64 and may omit this field. |
Callbacks & events #
Barkoder.startScanning(success, error);
Barkoder.scanImage(base64, success, error);
The success callback receives a raw scan result. Convert it with new BarkoderResult(data), as shown below. Use startScanning and scanImage separately; they share the same result callback.
Set closeSessionOnResultEnabled to false to receive further results without closing the session. Call stopScanning() to stop scanning.
For scanImage, pass the image's Base64 content without the data URL prefix. Initialize the scanner first and supply a valid image; invalid input may not invoke an error callback.
captureImage requests a frame; its completion callback does not return the image. Available image data arrives through the scan-result callback. Enable setImageResultEnabled(true) or setBarcodeThumbnailOnResultEnabled(true) to request images or thumbnails. AR scanning uses the corresponding setARImageResultEnabled and setARBarcodeThumbnailOnResultEnabled settings. Images may still be absent.
Result Example #
Run after the platform is ready, the license key is registered, and the scanner is initialized with the required barcode types enabled.
import { BarkoderResult } from 'plugins/barkoder-cordova-plugin/www/BarkoderConfig';
declare var Barkoder: any;
Barkoder.startScanning((data: any) => {
const barkoderResult = new BarkoderResult(data);
barkoderResult.decoderResults.forEach((result) => {
console.log(result.barcodeTypeName, result.textualData);
});
}, (err: any) => {
console.error(err);
});
barkoderCloseButtonTappedEvent #
Use this event only when handling taps on the button configured with configureCloseButton(...). It has no custom payload. Register after the platform is ready and remove the handler when the view is disposed.
declare const Barkoder: any;
function onCloseButtonTapped(): void {
Barkoder.stopScanning();
}
document.addEventListener('barkoderCloseButtonTappedEvent', onCloseButtonTapped);
function removeCloseButtonListener(): void {
document.removeEventListener('barkoderCloseButtonTappedEvent', onCloseButtonTapped);
}
Call removeCloseButtonListener() when disposing the view.
Enums #
These are the complete exported enums from the TypeScript helper module. Import them from plugins/barkoder-cordova-plugin/www/BarkoderConfig. Members are numeric; names and capitalization below are the public TypeScript spellings. For example, BarkoderCameraPosition.FRONT is 1. Native SDK names are not the JavaScript member names.
DecodingSpeed #
Used by setDecodingSpeed and returned through the success callback of getDecodingSpeed.
| Member | Value |
|---|---|
fast | 0 |
normal | 1 |
slow | 2 |
rigorous | 3 |
FormattingType #
Used by setFormattingType and returned through the success callback of getFormattingType.
| Member | Value |
|---|---|
disabled | 0 |
automatic | 1 |
gs1 | 2 |
aamva | 3 |
sadl | 4 |
bcbp | 5 |
MsiChecksumType #
Used by setMsiChecksumType and returned through the success callback of getMsiChecksumType.
| Member | Value |
|---|---|
disabled | 0 |
mod10 | 1 |
mod11 | 2 |
mod1010 | 3 |
mod1110 | 4 |
mod11IBM | 5 |
mod1110IBM | 6 |
Code39ChecksumType #
Used by setCode39ChecksumType and returned through the success callback of getCode39ChecksumType.
| Member | Value |
|---|---|
disabled | 0 |
enabled | 1 |
Code11ChecksumType #
Used by setCode11ChecksumType and returned through the success callback of getCode11ChecksumType.
| Member | Value |
|---|---|
disabled | 0 |
single | 1 |
double | 2 |
BarkoderCameraPosition #
Used by setCamera.
| Member | Value |
|---|---|
BACK | 0 |
FRONT | 1 |
BarkoderResolution #
Used by setBarkoderResolution and returned through the success callback of getBarkoderResolution.
| Member | Value |
|---|---|
HD | 0 |
FHD | 1 |
UHD | 2 |
BarkoderRoiCenterMark #
Used by setRoiCenterMark and returned through the success callback of getRoiCenterMark.
| Member | Value |
|---|---|
none | 0 |
crosshair | 1 |
point | 2 |
BarcodeType #
Used as the type argument of setBarcodeTypeEnabled, isBarcodeTypeEnabled, setBarcodeTypeLengthRange, and getBarcodeTypeLengthRange. Listing a type does not mean every operation supports it, such as length-range configuration for every decoder. The result model's barcodeType is a native result identifier, not a property declared with this enum type; use barcodeTypeName for the returned name.
| Member | Value |
|---|---|
aztec | 0 |
aztecCompact | 1 |
qr | 2 |
qrMicro | 3 |
code128 | 4 |
code93 | 5 |
code39 | 6 |
codabar | 7 |
code11 | 8 |
msi | 9 |
upcA | 10 |
upcE | 11 |
upcE1 | 12 |
ean13 | 13 |
ean8 | 14 |
pdf417 | 15 |
pdf417Micro | 16 |
datamatrix | 17 |
code25 | 18 |
interleaved25 | 19 |
itf14 | 20 |
iata25 | 21 |
matrix25 | 22 |
datalogic25 | 23 |
coop25 | 24 |
code32 | 25 |
telepen | 26 |
dotcode | 27 |
idDocument | 28 |
databar14 | 29 |
databarLimited | 30 |
databarExpanded | 31 |
postalIMB | 32 |
postnet | 33 |
planet | 34 |
australianPost | 35 |
royalMail | 36 |
kix | 37 |
japanesePost | 38 |
maxiCode | 39 |
ocrText | 40 |
BarkoderARMode #
Used by setARMode and returned through the success callback of getARMode.
| Member | Value |
|---|---|
off | 0 |
interactiveDisabled | 1 |
interactiveEnabled | 2 |
nonInteractive | 3 |
matchFilter | 4 |
BarkoderAROverlayRefresh #
Used by setAROverlayRefresh and returned through the success callback of getAROverlayRefresh.
| Member | Value |
|---|---|
smooth | 0 |
normal | 1 |
BarkoderARLocationType #
Used by setARLocationType and returned through the success callback of getARLocationType.
| Member | Value |
|---|---|
none | 0 |
tight | 1 |
boundingBox | 2 |
BarkoderARHeaderShowMode #
Used by setARHeaderShowMode and returned through the success callback of getARHeaderShowMode.
| Member | Value |
|---|---|
never | 0 |
always | 1 |
onSelected | 2 |
IdDocumentMasterChecksumType #
Used by the TypeScript IdDocumentBarcodeConfig.masterChecksum property.
| Member | Value |
|---|---|
disabled | 0 |
enabled | 1 |