barkoder-wasm / Exports
The barKoder Barcode Scanner SDK will fully transform the user's smartphones and tablets that deploy your Enterprise and Consumer apps into rugged barcode scanning devices without the need to procure and maintain expensive and sluggish hardware devices that have a very short life span.
Even though the barKoder barcode scanner SDK is a relatively new product, it is already more advanced than other competitor API's. Its robust barcode reading engine can be used to read the content of the most widely used barcodes with lightning fast speed and unprecedented recognition rate:
1D - Codabar, Code 11, Code 25, Code 39, Code 93, Code 128, DotCode, EAN-8, EAN-13, Interleaved 2 of 5, ITF-14, MSI Plessey, Pharmacode, Telepen, UPC-A & UPC-E
2D - Aztec Code, Aztec Compact, Data Matrix, DotCode, PDF417, Micro PDF417, QR Code & Micro QR Code
The barKoder SDK features multiple algorithms that handle a wide variety of barcode scanning scenarios with unprecedented performance in terms of speed and success rate:
You can check out our free demo app Barcode Scanner by barKoder available both via Apple App Store & Google Play Store.
If you run the barKoder Barcode Scanner SDK without a valid trial or production license, all results upon successful barcode scans will be partially masked by asterisks (*). You can get a trial license simply by registering on the barKoder Portal and utilizing the self-service for Evaluation License Generation! Each trial license will be good for an initial duration of 30 days and can be deployed to up to 25 devices. For any custom requirements, contact our sales team via sales@barkoder.com
Note that a trial license is only supposed to be utilized in a development or staging environment.
Our support is completely free for integration or testing purposes and granted through the barKoder Portal. After registering and logging into your account, you only need to submit a Support Issue form. Alternatively, you can contact us by email via support@barkoder.com.
WebAssembly is a type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and is designed to run alongside JavaScript. The following requirements need to be met:
npm install barkoder-wasm
If you would like to install from a local folder you will need to follow these steps:
npm install "./barkoder-wasm"
Copy both barkoder-umd.js and barkoder.wasm to your page's directory.
Include the barkoder-umd.js script:
<script type="text/javascript" src="barkoder-umd.js"></script>
Copy barkoder.wasm to your page's directory (i.e. dist).
Require the UMD Module:
var BarkoderSDK = require('barkoder-wasm');
Then,
async function barkoderInit () {
var Barkoder = await BarkoderSDK.initialize("your_license_key_here");
//enable symbologies you'd like to scan
Barkoder.setEnabledDecoders(
Barkoder.constants.Decoders.QR,
Barkoder.constants.Decoders.Ean8,
Barkoder.constants.Decoders.PDF417
);
//change any additional settings
Barkoder.setCameraResolution(Barkoder.constants.CameraResolution.FHD);
Barkoder.setDecodingSpeed(Barkoder.constants.DecodingSpeed.Normal);
}
barkoderInit(); //using await requires an async method
<div id="barkoder-container" style="width: 500px; height: 300px;"></div>
Additionally add style for size, position, background color, etc.
Note that the container element needs to have a defined size, otherwise the SDK will set half the window size as fallback.
let callbackMethod = (result)=>alert(result.barcodeTypeName + '\n' + result.textualData);
Barkoder.startScanner(callbackMethod);
Barkoder.stopScanner();
Barkoder.scanImage('test.png', callbackMethod);
The initialize method must be called first. After it completes, it returns an object with the following members:
constants: object
startScanner(resultCallback?: function): number
stopScanner()
scanImage(imageUri: string, resultCallback?: function)
setPauseDecoding(pause: boolean)
setRegionOfInterest(left: number, top: number, width: number, height: number)
setCameraResolution(cameraResolution: number)
getCameras(): Promise<object>
setCameraId(cameraId: string)
setFlashEnabled(flashEnabled: boolean): number
setZoomEnabled(zoomEnabled: boolean): number
setCloseEnabled(closeEnabled: boolean): number
setCameraPickerEnabled(cameraPickerEnabled: boolean): number
changeFlashState()
changeZoomState()
setContinuous(continuous: boolean): number
setDpsLimit(setDpsLimit: number)
applyTemplate(templateFile: string, templateMode: string)
setLengthRange(decoder: number, minimumLength: number, maximumLength: number)
setCode11ChecksumType(code11ChecksumType: number): number
setCode39ChecksumType(code39ChecksumType: number): number
setMsiChecksumType(msiChecksumType: number): number
setDatamatrixDpmModeEnabled(dpmModeEnabled: boolean): number
setEncodingCharacterSet(encodingCharacterSet: number)
setDecodingSpeed(decodingSpeed: number)
setFormatting(formatting: number)
setEnabledDecoders(...args: number)
setMulticodeCachingEnabled(multicodeCachingEnabled: number)
setMulticodeCachingDuration(multicodeCachingDuration: number)
setDuplicatesDelayMs(duplicatesDelayMs: number)
setUpcEanDeblur(deblur: number)
setEnableMisshaped1D(enableMisshaped1D: number)
setEnableVINRestrictions(enableVINRestrictions: number)
getVersion(): { barkoderWebVersion: string, barkoderVersion: string, barkoderFullVersion: string }
getRegionOfInterest(): { x:number, y:number, width: number, height: number }
getDecodingSpeed(): number
getFormatting(): number
getDuplicatesDelayMs(): number
getUpcEanDeblur(): number
getEnableMisshaped1D(): number
getEnableVINRestrictions(): number
barkoder-wasm / Exports / BarkoderSDK / CameraResolution
BarkoderSDK.CameraResolution
• HD = 0
High Definition: 1280x720
• FHD = 1
Full HD: 1920x1080
barkoder-wasm / Exports / BarkoderSDK / Code11ChecksumType
BarkoderSDK.Code11ChecksumType
Code11ChecksumType
Code 11 checksum types.
• disabled = 0
• single = 1
• double = 2
barkoder-wasm / Exports / BarkoderSDK / Code39ChecksumType
BarkoderSDK.Code39ChecksumType
Code39ChecksumType
Code 39 checksum types.
• disabled = 0
• enabled = 1
barkoder-wasm / Exports / BarkoderSDK / Decoders
BarkoderSDK.Decoders
Decoders
Supported decoders (barcode types).
• 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
barkoder-wasm / Exports / BarkoderSDK / DecodingSpeed
BarkoderSDK.DecodingSpeed
DecodingSpeed
This setting determines the pace at which the system processes and decodes barcode information, affecting the speed of barcode scanning.
• Fast = 0
Scanner will spend less time on decoding. While this if faster, it may not detect more demanding barcodes.
• Normal = 1
Default. Scanner holds a balance between how long decoding takes, and the success rate of detecting barcodes.
• Slow = 2
Scanner will spend more time on decoding. While this is slower, it may detect very demanding barcodes that cannot be read otherwise.
barkoder-wasm / Exports / BarkoderSDK / EncodingCharacterSet
BarkoderSDK.EncodingCharacterSet
• None = ""
barkoder-wasm / Exports / BarkoderSDK / Formatting
BarkoderSDK.Formatting
Formatting
This setting determines if the decoder should apply a specific formatting to results.
• Disabled = 0
Keep the raw result.
• Automatic = 1
Detect if result is parsable and apply parsing if so.
• GS1 = 2
Use GS1 parser.
• AAMVA = 3
Use AAMVA parser.
barkoder-wasm / Exports / BarkoderSDK / MsiChecksumType
BarkoderSDK.MsiChecksumType
MsiChecksumType
MSI checksum types.
• disabled = 0
• mod10 = 1
• mod11 = 2
• mod1010 = 3
• mod1110 = 4
• mod11IBM = 5
• mod1110IBM = 6
barkoder-wasm / Exports / BarkoderSDK / Barkoder
BarkoderSDK.Barkoder
• constants: Object
####### Type declaration
Name | Type | Description |
---|---|---|
DecodingSpeed |
DecodingSpeed |
- |
Decoders |
Decoders |
- |
Code11ChecksumType |
Code11ChecksumType |
- |
Code39ChecksumType |
Code39ChecksumType |
- |
MsiChecksumType |
MsiChecksumType |
- |
UpcEanDeblur |
{ Disable : 0 ; Enable : 1 } |
UpcEanDeblur Should the decoder try to decode UPC/EAN barcodes that might appear blurry or unclear. |
UpcEanDeblur.Disable |
0 |
- |
UpcEanDeblur.Enable |
1 |
- |
MulticodeCachingEnabled |
{ Disable : 0 ; Enable : 1 } |
MulticodeCachingEnabled Should the decoder cache multicodes. |
MulticodeCachingEnabled.Disable |
0 |
- |
MulticodeCachingEnabled.Enable |
1 |
- |
EnableMisshaped1D |
{ Disable : 0 ; Enable : 1 } |
EnableMisshaped1D Should the decoder try to decode misshaped or distorted 1D barcodes. |
EnableMisshaped1D.Disable |
0 |
- |
EnableMisshaped1D.Enable |
1 |
- |
EnableVINRestrictions |
{ Disable : 0 ; Enable : 1 } |
EnableVINRestrictions Should the decoder apply VIN restrictions. |
EnableVINRestrictions.Disable |
0 |
- |
EnableVINRestrictions.Enable |
1 |
- |
Formatting |
Formatting |
- |
EncodingCharacterSet |
None |
EncodingCharacterSet This setting determines if the decoder should apply a specific encoding to results. |
CameraResolution |
CameraResolution |
CameraResolution This setting determines the camera resolution that will be used during the scanning session. It determines the level of detail and clarity in barcode images. |
• startScanner: (resultCallback?
: (result
: Result
) => void
) => number
Starts the scanner. This will access and start the camera, creates a preview to show the stream and adds it to a container element, and decode frames from it.
<div id="barkoder-container" style="width: 500px; height: 300px;"></div>
Note that the container element needs to have a defined size, otherwise the SDK will set half the window size as fallback.
Calling the startScanner method involves camera access and requests user permissions if needed. Camera-related errors could be returned in result.error, depending on device features and user permissions.
Note that HTTPS connection is required for camera usage (unless on localhost).
Param
Result callback.
####### Type declaration
▸ (resultCallback?
): number
Starts the scanner. This will access and start the camera, creates a preview to show the stream and adds it to a container element, and decode frames from it.
<div id="barkoder-container" style="width: 500px; height: 300px;"></div>
Note that the container element needs to have a defined size, otherwise the SDK will set half the window size as fallback.
Calling the startScanner method involves camera access and requests user permissions if needed. Camera-related errors could be returned in result.error, depending on device features and user permissions.
Note that HTTPS connection is required for camera usage (unless on localhost).
######## Parameters
Name | Type | Description |
---|---|---|
resultCallback? |
(result : Result ) => void |
Result callback. |
######## Returns
number
Returns the scanning state:
0
if a new scanning session has been started.1
if a previous scanning session is already running.-1
if there is no container element.• stopScanner: () => void
Stops a previously started scanning session by startScanner.
####### Type declaration
▸ (): void
Stops a previously started scanning session by startScanner.
######## Returns
void
• scanImage: (imageUri
: string
, resultCallback?
: (result
: Result
) => void
) => void
| Promise
<Result
>
Scans a single image.
Param
The path and name of the image.
Param
Result callback.
####### Type declaration
▸ (imageUri
, resultCallback?
): void
| Promise
<Result
>
Scans a single image.
######## Parameters
Name | Type | Description |
---|---|---|
imageUri |
string |
The path and name of the image. |
resultCallback? |
(result : Result ) => void |
Result callback. |
######## Returns
void
| Promise
<Result
>
If using a callback, nothing is returned, instead, the callback will execute. If not using a callback, a Promise of the result is returned.
• setPauseDecoding: (pause
: boolean
) => void
Set the decoding state of the scanner.
Param
Pause the decoding.
####### Type declaration
▸ (pause
): void
Set the decoding state of the scanner.
######## Parameters
Name | Type | Description |
---|---|---|
pause |
boolean |
Pause the decoding. |
######## Returns
void
• setRegionOfInterest: (left
: number
, top
: number
, width
: number
, height
: number
) => void
Set the desired region of interested. The decoder will only look at this area for barcodes.
Param
Percentage of the starting point on the x-axis of the preview.
Param
Percentage of the starting point on the y-axis of the preview.
Param
Percentage of the width of the preview.
Param
Percentage of the height of the preview.
####### Type declaration
▸ (left
, top
, width
, height
): void
Set the desired region of interested. The decoder will only look at this area for barcodes.
######## Parameters
Name | Type | Description |
---|---|---|
left |
number |
Percentage of the starting point on the x-axis of the preview. |
top |
number |
Percentage of the starting point on the y-axis of the preview. |
width |
number |
Percentage of the width of the preview. |
height |
number |
Percentage of the height of the preview. |
######## Returns
void
• setCameraResolution: (cameraResolution
: CameraResolution
) => number
Set the desired camera resolution.
Note that if device is not capable of providing the exact resolution, the closest available one will be used.
Param
The camera resolution to request from the device.
####### Type declaration
▸ (cameraResolution
): number
Set the desired camera resolution.
Note that if device is not capable of providing the exact resolution, the closest available one will be used.
######## Parameters
Name | Type | Description |
---|---|---|
cameraResolution |
CameraResolution |
The camera resolution to request from the device. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• getCameras: () => Promise
<Cameras
>
Get all available cameras from the device.
Note that this method may prompt the user for camera access permissions, if they are not already granted.
####### Type declaration
▸ (): Promise
<Cameras
>
Get all available cameras from the device.
Note that this method may prompt the user for camera access permissions, if they are not already granted.
######## Returns
Promise
<Cameras
>
Returns a Promise of an array with all found cameras.
• setCameraId: (cameraId
: string
) => void
Set the desired camera to use.
Param
The camera id previously obtained from getCameras.
####### Type declaration
▸ (cameraId
): void
Set the desired camera to use.
######## Parameters
Name | Type | Description |
---|---|---|
cameraId |
string |
The camera id previously obtained from getCameras. |
######## Returns
void
• setFlashEnabled: (flashEnabled
: boolean
) => number
Enable flash button on camera preview.
Param
Enable or disable flash button on camera preview. Default is enabled.
####### Type declaration
▸ (flashEnabled
): number
Enable flash button on camera preview.
######## Parameters
Name | Type | Description |
---|---|---|
flashEnabled |
boolean |
Enable or disable flash button on camera preview. Default is enabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setZoomEnabled: (zoomEnabled
: boolean
) => number
Enable zoom button on camera preview.
Param
Enable or disable zoom button on camera preview. Default is enabled.
####### Type declaration
▸ (zoomEnabled
): number
Enable zoom button on camera preview.
######## Parameters
Name | Type | Description |
---|---|---|
zoomEnabled |
boolean |
Enable or disable zoom button on camera preview. Default is enabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setCloseEnabled: (closeEnabled
: boolean
) => number
Enable close button on camera preview.
Param
Enable or disable close button on camera preview. Default is enabled.
####### Type declaration
▸ (closeEnabled
): number
Enable close button on camera preview.
######## Parameters
Name | Type | Description |
---|---|---|
closeEnabled |
boolean |
Enable or disable close button on camera preview. Default is enabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setCameraPickerEnabled: (cameraPickerEnabled
: boolean
) => number
Enable cameraPicker button on camera preview.
Param
Enable or disable cameraPicker button on camera preview. Default is enabled.
####### Type declaration
▸ (cameraPickerEnabled
): number
Enable cameraPicker button on camera preview.
######## Parameters
Name | Type | Description |
---|---|---|
cameraPickerEnabled |
boolean |
Enable or disable cameraPicker button on camera preview. Default is enabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• changeFlashState: () => void
Change i.e. toggle the current flash state.
Should be used only during an active scanning session. Outside of one, there is no effect.
####### Type declaration
▸ (): void
Change i.e. toggle the current flash state.
Should be used only during an active scanning session. Outside of one, there is no effect.
######## Returns
void
• changeZoomState: () => void
Change i.e. cycle through the current zoom state.
Should be used only during an active scanning session. Outside of one, there is no effect.
####### Type declaration
▸ (): void
Change i.e. cycle through the current zoom state.
Should be used only during an active scanning session. Outside of one, there is no effect.
######## Returns
void
• setContinuous: (continuous
: boolean
) => number
Enable continuous scanning.
Param
Enable or disable continuous scanning. Default is disabled.
####### Type declaration
▸ (continuous
): number
Enable continuous scanning.
######## Parameters
Name | Type | Description |
---|---|---|
continuous |
boolean |
Enable or disable continuous scanning. Default is disabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setDpsLimit: (dpsLimit
: number
) => number
Set the desired decodes per second limit.
This setting affects how often the scanner will try to decode a frame. Higher values increase the likelihood of barcodes being detected faster, but is also more demanding on the device.
Param
The DPS limit to apply. Default value is 2. Accepts values in the range of 1-30.
####### Type declaration
▸ (dpsLimit
): number
Set the desired decodes per second limit.
This setting affects how often the scanner will try to decode a frame. Higher values increase the likelihood of barcodes being detected faster, but is also more demanding on the device.
######## Parameters
Name | Type | Description |
---|---|---|
dpsLimit |
number |
The DPS limit to apply. Default value is 2. Accepts values in the range of 1-30. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• applyTemplate: (templateFile
: string
, templateMode
: string
) => void
Apply a set of pre-defined settings from a file.
Param
The template file in json format, containing settings for different template modes.
Param
The template mode to apply.
####### Type declaration
▸ (templateFile
, templateMode
): void
Apply a set of pre-defined settings from a file.
######## Parameters
Name | Type | Description |
---|---|---|
templateFile |
string |
The template file in json format, containing settings for different template modes. |
templateMode |
string |
The template mode to apply. |
######## Returns
void
• setLengthRange: (decoder
: Decoders
, minimumLength
: number
, maximumLength
: number
) => number
Set the minimum and maximum length to be detected.
Param
Decoder (barcode) type.
Param
Barcodes with at least this length.
Param
Barcodes with this length at most.
####### Type declaration
▸ (decoder
, minimumLength
, maximumLength
): number
Set the minimum and maximum length to be detected.
######## Parameters
Name | Type | Description |
---|---|---|
decoder |
Decoders |
Decoder (barcode) type. |
minimumLength |
number |
Barcodes with at least this length. |
maximumLength |
number |
Barcodes with this length at most. |
######## Returns
number
Returns the set state.
• setCode11ChecksumType: (code11ChecksumType
: number
) => number
Set checksum type for Code 11.
Param
Code 11 checksum type.
####### Type declaration
▸ (code11ChecksumType
): number
Set checksum type for Code 11.
######## Parameters
Name | Type | Description |
---|---|---|
code11ChecksumType |
number |
Code 11 checksum type. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setCode39hecksumType: (code39ChecksumType
: number
) => number
Set checksum type for Code 39.
Param
Code 39 checksum type.
####### Type declaration
▸ (code39ChecksumType
): number
Set checksum type for Code 39.
######## Parameters
Name | Type |
---|---|
code39ChecksumType |
number |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setMsiChecksumType: (msiChecksumType
: number
) => number
Set checksum type for MSI.
Param
MSI checksum type.
####### Type declaration
▸ (msiChecksumType
): number
Set checksum type for MSI.
######## Parameters
Name | Type | Description |
---|---|---|
msiChecksumType |
number |
MSI checksum type. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setDatamatrixDpmModeEnabled: (dpmModeEnabled
: boolean
) => number
Enable Datamatrix dpm mode.
Param
Enable or disable dpm mode.
####### Type declaration
▸ (dpmModeEnabled
): number
Enable Datamatrix dpm mode.
######## Parameters
Name | Type | Description |
---|---|---|
dpmModeEnabled |
boolean |
Enable or disable dpm mode. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setEncodingCharacterSet: (encodingCharacterSet
: number
) => void
Set the character set to be used for encoding the results.
Param
The character set to apply.
####### Type declaration
▸ (encodingCharacterSet
): void
Set the character set to be used for encoding the results.
######## Parameters
Name | Type | Description |
---|---|---|
encodingCharacterSet |
number |
The character set to apply. |
######## Returns
void
• setDecodingSpeed: (decodingSpeed
: DecodingSpeed
) => number
Set the pace and effort at which the scanner will try to decode barcodes.
Param
The decoding speed to apply. Default is Normal.
####### Type declaration
▸ (decodingSpeed
): number
Set the pace and effort at which the scanner will try to decode barcodes.
######## Parameters
Name | Type | Description |
---|---|---|
decodingSpeed |
DecodingSpeed |
The decoding speed to apply. Default is Normal. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setFormatting: (formatting
: Formatting
) => number
Set the type of formatting to apply to results.
Param
The formatting type to apply. Default is Disabled.
####### Type declaration
▸ (formatting
): number
Set the type of formatting to apply to results.
######## Parameters
Name | Type | Description |
---|---|---|
formatting |
Formatting |
The formatting type to apply. Default is Disabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setEnabledDecoders: (...decoders
: Decoders
[]) => void
Set the decoders to enable.
Note that this method uses a rest parameter i.e. accepts an indefinite number of arguments.
Param
The decoders to enable. This is a rest parameter i.e. accepts an indefinite number of arguments.
####### Type declaration
▸ (...decoders
): void
Set the decoders to enable.
Note that this method uses a rest parameter i.e. accepts an indefinite number of arguments.
######## Parameters
Name | Type |
---|---|
...decoders |
Decoders [] |
######## Returns
void
• setMulticodeCachingEnabled: (multicodeCachingEnabled
: number
) => number
Enable caching of multicodes.
Param
Enable or disable multicode caching. Default is Disabled.
####### Type declaration
▸ (multicodeCachingEnabled
): number
Enable caching of multicodes.
######## Parameters
Name | Type | Description |
---|---|---|
multicodeCachingEnabled |
number |
Enable or disable multicode caching. Default is Disabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setMulticodeCachingDuration: (multicodeCachingDuration
: number
) => number
Set the duration for multicode caching.
Param
The duration in ms.
####### Type declaration
▸ (multicodeCachingDuration
): number
Set the duration for multicode caching.
######## Parameters
Name | Type | Description |
---|---|---|
multicodeCachingDuration |
number |
The duration in ms. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setDuplicatesDelayMs: (duplicatesDelayMs
: number
) => number
Set the delay for duplicate results.
Param
The delay duration in ms.
####### Type declaration
▸ (duplicatesDelayMs
): number
Set the delay for duplicate results.
######## Parameters
Name | Type | Description |
---|---|---|
duplicatesDelayMs |
number |
The delay duration in ms. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setUpcEanDeblur: (deblur
: number
) => number
Enable deblurring of UPC/EAN barcodes.
Param
Enable or disable deblur. Default is Disabled.
####### Type declaration
▸ (deblur
): number
Enable deblurring of UPC/EAN barcodes.
######## Parameters
Name | Type | Description |
---|---|---|
deblur |
number |
Enable or disable deblur. Default is Disabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setEnableMisshaped1D: (enableMisshaped1D
: number
) => number
Enable detection of misshaped 1D barcodes.
Param
Enable or disable misshaped detection. Default is Disabled.
####### Type declaration
▸ (enableMisshaped1D
): number
Enable detection of misshaped 1D barcodes.
######## Parameters
Name | Type | Description |
---|---|---|
enableMisshaped1D |
number |
Enable or disable misshaped detection. Default is Disabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• setEnableVINRestrictions: (enableVINRestrictions
: number
) => number
Enable VIN restrictions.
Param
Enable or disable VIN restrictions. Default is Disabled.
####### Type declaration
▸ (enableVINRestrictions
): number
Enable VIN restrictions.
######## Parameters
Name | Type | Description |
---|---|---|
enableVINRestrictions |
number |
Enable or disable VIN restrictions. Default is Disabled. |
######## Returns
number
Returns the set state:
0
if argument was good.-1
if argument was bad.• getVersion: () => { barkoderWebVersion
: string
; barkoderVersion
: string
; barkoderFullVersion
: string
}
Get the BarkoderSDK version details.
####### Type declaration
▸ (): Object
Get the BarkoderSDK version details.
######## Returns
Object
Name | Type |
---|---|
barkoderWebVersion |
string |
barkoderVersion |
string |
barkoderFullVersion |
string |
• getRegionOfInterest: () => { x
: number
; y
: number
; width
: number
; height
: number
}
Get the currently used region of interest.
Note that these values may be different during active scanning than the ones set by setRegionOfInterest.
####### Type declaration
▸ (): Object
Get the currently used region of interest.
Note that these values may be different during active scanning than the ones set by setRegionOfInterest.
######## Returns
Object
Name | Type |
---|---|
x |
number |
y |
number |
width |
number |
height |
number |
• getDecodingSpeed: () => DecodingSpeed
Get the decoding speed.
####### Type declaration
▸ (): DecodingSpeed
Get the decoding speed.
######## Returns
• getFormatting: () => Formatting
Get the formatting type.
####### Type declaration
▸ (): Formatting
Get the formatting type.
######## Returns
• getDuplicatesDelayMs: () => number
Get the duplicates delay.
####### Type declaration
▸ (): number
Get the duplicates delay.
######## Returns
number
• getUpcEanDeblur: () => number
Get the UPC/EAN deblur state.
####### Type declaration
▸ (): number
Get the UPC/EAN deblur state.
######## Returns
number
• getEnableMisshaped1D: () => number
Get the misshaped 1D state.
####### Type declaration
▸ (): number
Get the misshaped 1D state.
######## Returns
number
• getEnableVINRestrictions: () => number
Get the VIN restrictions state.
####### Type declaration
▸ (): number
Get the VIN restrictions state.
######## Returns
number
barkoder-wasm / Exports
barkoder-wasm / Exports / BarkoderSDK
Ƭ Result: Object
####### Type declaration
Name | Type | Description |
---|---|---|
barcodeTypeName |
string |
The name of the barcode type. |
binaryData |
number [] |
The result as an array of bytes. |
capturedFrame |
ImageData |
The frame where a barcode was detected. |
gs1 |
number |
The result is GS1 compliant. |
location |
{ p1 : { x : number ; y : number } ; p2 : { x : number ; y : number } ; p3 : { x : number ; y : number } ; p4 : { x : number ; y : number } } |
The location of the result in the frame/image. |
location.p1 |
{ x : number ; y : number } |
- |
location.p1.x |
number |
- |
location.p1.y |
number |
- |
location.p2 |
{ x : number ; y : number } |
- |
location.p2.x |
number |
- |
location.p2.y |
number |
- |
location.p3 |
{ x : number ; y : number } |
- |
location.p3.x |
number |
- |
location.p3.y |
number |
- |
location.p4 |
{ x : number ; y : number } |
- |
location.p4.x |
number |
- |
location.p4.y |
number |
- |
resultsCount |
number |
The amount of results. |
textualData |
string |
The result as text. Note that without adequate formatting, certain characters cannot be shown (e.g. non-printable characters). Refer to binaryData. |
type? |
string |
This field is present only when an error occurs after a startScanner call i.e. has the value "error". |
error? |
{ name : string ; message : string } |
The error information. This field is present only when an error occurs after a startScanner call. |
error.name |
string |
The name of the error. Common errors that could happen: - SecurityError - OverconstrainedError - NotReadableError - NotAllowedError - NotFoundError - AbortError |
error.message |
string |
Details about the error. |
Ƭ Cameras: { id
: string
; label
: string
}[]
▸ initialize(license
): Promise
<Barkoder
>
Initialize the BarkoderSDK.
This function must always be called first and returns a promise, which if resolved successfully, provides the Barkoder object.
####### Parameters
Name | Type |
---|---|
license |
string |
####### Returns
Promise
<Barkoder
>
Promise
Returns a promise which resolves to Barkoder.