UBNativeScanner

UBNativeScanner

new UBNativeScanner(config)

Scanner & BarCode printing. Require native messages feature 'scanner' to be installed.
Arguments:
  1. config (Object)  initial parameters
    Properties
    1. [waitTimeout=180000] (Number)  Default timeout for scanner operation (in ms)
Author:
  • pavel.mash

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:
  1. settings (Object)

startScan(paramsopt) → Promise

Begin scan process. Params is applied to UBNativeScanner.getDefaultSettings result
Arguments:
  1. [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:
  1. barcodeConfig (object)
    Properties
    1. betweenColumns (object)  Number of space (in pixel) between columns
    2. items (Array.<barCodeItemConfig>)
  2. [printerSettings] (object)  only BarcodeSettings section of config. If empty then use Default printer
    Properties
    1. [SupplementType] (string)
    2. [PrinterName] (string)
    3. [UseDefaultPrinter] (boolean)
    4. [LeftMargin] (number)
    5. [TopMargin] (number)
    6. [RightMargin] (number)
    7. [BottomMargin] (number)
    8. [Rotate180] (boolean)
    9. [pagePosition="bcppBottomRight"] (string)  Barcode position on page. One of TopLeft, TopCenter, TopRight, BottomLeft, BottomCenter, BottomRight