layout | needAutoGenerateSidebar | title | keywords | breadcrumbText | description | permalink |
---|---|---|---|---|---|---|
default-layout |
true |
Dynamic Web TWAIN SDK API Reference - BarcodeReader Addon APIs |
Dynamic Web TWAIN, Documentation, API Reference, BarcodeReader Addon APIs |
Barcode Reader Addon |
Dynamic Web TWAIN SDK Documentation API Reference BarcodeReader Addon APIs Page |
/info/api/Addon_BarcodeReader.html |
{WebTwainObject} denotes the
WebTwain
instance.
Methods
| |
| :----------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| decode()
| getRuntimeSettings()
| updateRuntimeSettings()
|
| resetRuntimeSettings()
| initRuntimeSettingsWithString()
|
Read an image in the buffer and try to locate and decode barcode(s) on it. Please refer to TextResult
.
Syntax
decode(index: number): Promise<TextResult[]> ;
Parameters
index
: Specify the image to decode.
Availability
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) |
v14.3.1+ | v14.1+ | not supported | not supported | not supported |
Return the current runtime settings or the settings of the specified built-in template. Please refer to RuntimeSettings
.
The template can only be "speed", "balance", or "coverage".
Syntax
getRuntimeSettings(template?: string): Promise<RuntimeSettings> ;
Availability
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) |
v14.3.1+ | v14.1+ | not supported | not supported | not supported |
Update the runtime settings with a given object or use the string "speed", "balance", or "coverage" to use our preset settings. The default setting is "coverage".
Syntax
updateRuntimeSettings(settings: RuntimeSettings): Promise<RuntimeSettings> ;
Parameters
settings
: Specify the runtime settings. Please refer to RuntimeSettings
.
Availability
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) |
v14.3.1+ | v14.1+ | not supported | not supported | not supported |
Example
DWTObject.Addon.BarcodeReader.getRuntimeSettings("balance")
.then(function (settings) {
settings.barcodeFormatIds = Dynamsoft.DBR.EnumBarcodeFormat.BF_ONED;
return DWTObject.Addon.BarcodeReader.updateRuntimeSettings(settings);
})
.then(function () {
DWTObject.Addon.BarcodeReader.decode(0).then(
function (textResult) {
console.log(textResult);
},
function (ex) {
console.log(ex.message || ex);
}
);
});
Reset all runtime settings to default values. Please refer to RuntimeSettings
.
Syntax
resetRuntimeSettings(): Promise<RuntimeSettings> ;
Availability
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) |
v14.3.1+ | v14.1+ | not supported | not supported | not supported |
Set up the barcode reader with advanced settings.
Syntax
initRuntimeSettingsWithString(
settings: string
): Promise<RuntimeSettings> ;
Parameters
settings
: The runtime setting in the form of a string.
Return value
Please refer to RuntimeSettings
.
Availability
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) |
v16.0+ | v16.0+ | not supported | not supported | not supported |