new UBNativeScanner(config)
Scanner & BarCode printing. Require native messages feature 'scanner' to be installed.
Arguments:
-
config
(Object)
 initial parametersProperties
-
[waitTimeout=180000]
(Number)
 Default timeout for scanner operation (in ms)
-
Members
nm: UBNativeMessage
protected
Native messages plugin instance
Methods
init() → Promise
Initialize scanner
getScanners() → Promise
Get array of scanners, installed in OS
getPrinters() → Promise
Get array of printers, installed in OS
getDefaultSettings() → Promise
Read scanner & printer settings stored in file system
setDefaultSettings(settings) → Promise
Store scanner & printer settings to file system
Arguments:
-
settings
(Object)
startScan(paramsopt) → Promise
Begin scan process. Params is applied to UBNativeScanner.getDefaultSettings result
Arguments:
-
[params]
(Object)
continueScan() → Promise
Continue previously started scan process (scan more pages)
finishScan() → Promise
Finish previously started scan process. Return a promise resolved to scan result as base64 encoded string.
Will free any memory and delete temporary files created by host application.
cancelScan() → Promise
Cancel previously started scan process, free memory and delete temporary files created by host application.
printBarCode(barcodeConfig, printerSettingsopt) → Promise
Print Barcode
Arguments:
-
barcodeConfig
(object)
Properties
-
betweenColumns
(object)
 Number of space (in pixel) between columns
-
items
(Array.<barCodeItemConfig>)
-
[printerSettings]
(object)
 only BarcodeSettings section of config. If empty then use Default printer
Properties
-
[SupplementType]
(string)
-
[PrinterName]
(string)
-
[UseDefaultPrinter]
(boolean)
-
[LeftMargin]
(number)
-
[TopMargin]
(number)
-
[RightMargin]
(number)
-
[BottomMargin]
(number)
-
[Rotate180]
(boolean)
-
[pagePosition="bcppBottomRight"]
(string)
 Barcode position on page. One of TopLeft, TopCenter, TopRight, BottomLeft, BottomCenter, BottomRight
init() → Promise
Initialize scanner
getScanners() → Promise
Get array of scanners, installed in OS
getPrinters() → Promise
Get array of printers, installed in OS
getDefaultSettings() → Promise
Read scanner & printer settings stored in file system
setDefaultSettings(settings) → Promise
Store scanner & printer settings to file system
Arguments:
-
settings
(Object)
startScan(paramsopt) → Promise
Begin scan process. Params is applied to UBNativeScanner.getDefaultSettings result
Arguments:
-
[params]
(Object)
continueScan() → Promise
Continue previously started scan process (scan more pages)
finishScan() → Promise
Finish previously started scan process. Return a promise resolved to scan result as base64 encoded string.
Will free any memory and delete temporary files created by host application.
cancelScan() → Promise
Cancel previously started scan process, free memory and delete temporary files created by host application.
printBarCode(barcodeConfig, printerSettingsopt) → Promise
Print Barcode
Arguments:
-
barcodeConfig
(object)
Properties
-
betweenColumns
(object)
 Number of space (in pixel) between columns -
items
(Array.<barCodeItemConfig>)
-
-
[printerSettings]
(object)
 only BarcodeSettings section of config. If empty then use Default printerProperties
-
[SupplementType]
(string)
-
[PrinterName]
(string)
-
[UseDefaultPrinter]
(boolean)
-
[LeftMargin]
(number)
-
[TopMargin]
(number)
-
[RightMargin]
(number)
-
[BottomMargin]
(number)
-
[Rotate180]
(boolean)
-
[pagePosition="bcppBottomRight"]
(string)
 Barcode position on page. One of TopLeft, TopCenter, TopRight, BottomLeft, BottomCenter, BottomRight
-