Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
Table of contents

{WebTwainObject} Util

{WebTwainObject} denotes the WebTwain instance.

Methods

Properties


isUsingActiveX

Syntax

/**
 * Return whether the WebTwain object is running the ActiveX edition.
 */
isUsingActiveX(): boolean;

RegisterEvent

Syntax

/**
 * Specify an event listener for the specified built-in event.
 * @param name Specify the event
 * @param callback The event listener
 */
RegisterEvent(name: string, callback: () => void): boolean;

UnregisterEvent

Syntax

/**
 * Remove an event listener from the specified built-in event.
 * @param name Specify the event
 * @param callback The event listener
 */
UnregisterEvent(name: string, callback: () => void): boolean;

Usage notes

There can only be one listener for each built-in event. If you call RegisterEvent on the same event again, the new callback will replace the old one.


SetProductKeyAsync

Syntax

/**
 * Set the product key.
 * @param productKey Specify the key.
 */
SetProductKeyAsync(
    productKey: string
): Promise<any>;

SetLanguage

Syntax

/**
 * Set the language for the authorization dialogs.
 * @param language Specify the language.
 */
SetLanguage(
    language: Dynamsoft.EnumDWT_Language | number
): boolean;

Usage notes

The language set with this method is only for the built-in security dialogs which show up when the user tries to access a scanner, a camera or a local file.


GenerateURLForUploadData

Syntax

/**
 * Generate a URL to be used by a FileUpoader instance to fetch the data to upload.
 * @param indices Specify the images to upload.
 * @param type Specify the file type.
 * @param successCallback A callback function that is executed if the request succeeds.
 * @param failureCallback A callback function that is executed if the request fails.
 * @argument resultURL The generated URL.
 * @argument indices The indices of the images.
 * @argument type The file type.
 */
GenerateURLForUploadData(
    indices: number[],
    type: Dynamsoft.EnumDWT_ImageType | number,
    successCallback: (
        resultURL: string,
        indices: number[],
        type: Dynamsoft.EnumDWT_ImageType | number
    ) => void,
    failureCallback: (
        errorCode: number,
        errorString: string
    ) => void
): void;

Usage notes

The language set with this method is only for the built-in security dialogs which show up when the user tries to access a scanner, a camera or a local file.


ErrorCode

Syntax

/**
 * Return the error code.
 */
readonly ErrorCode: number;

Usage notes

The ErrorCode and ErrorString always reflect the result of the last API call. So make sure you read them in time.

Check error list.


ErrorString

Syntax

/**
 * Return the error string.
 */
readonly ErrorString: string;

Usage notes

The ErrorCode and ErrorString always reflect the result of the last API call. So make sure you read them in time.

Check error list.


LogLevel

Syntax

/**
 * Return or set the log level for debugging.
 */
LogLevel: number;

Usage notes

The logs for the Dynamic Web TWAIN library are saved in the directory C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64\log\ . By default, LogLevel is 0 and nothing is recorded. When it is set to 1, all debugging information is recorded.

Setting LogLevel to 1/0 is equivalent to setting LogLevel to 14/1 in the file C:\Windows\SysWOW64\Dynamsoft\DynamsoftServicex64\DSConfiguration.ini .


Manufacturer

Syntax

/**
 * Manufacturer in the identity string of the Dynamic Web TWAIN library.
 */ 
readonly Manufacturer: string;

Usage notes

Manufacturer , ProductFamily , ProductName and VersionInfo together form the identity string of the Dynamic Web TWAIN library.


ProductFamily

Syntax

/**
 * ProductFamily in the identity string of the Dynamic Web TWAIN library.
 */
readonly ProductFamily: string;

Usage notes

Manufacturer , ProductFamily , ProductName and VersionInfo together form the identity string of the Dynamic Web TWAIN library.


ProductName

Syntax

/**
 * ProductName in the identity string of the Dynamic Web TWAIN library.
 */
readonly ProductName: string;

Usage notes

Manufacturer , ProductFamily , ProductName and VersionInfo together form the identity string of the Dynamic Web TWAIN library.


VersionInfo

Syntax

/**
 * VersionInfo in the identity string of the Dynamic Web TWAIN library.
 */
readonly VersionInfo: string;

Usage notes

Manufacturer , ProductFamily , ProductName and VersionInfo together form the identity string of the Dynamic Web TWAIN library.


ProductKey

Syntax

/**
 * Return or set the ProductKey.
 */
ProductKey: string;

Usage notes

The ProductKey contains the license to use the Dynamic Web TWAIN library. From version 16.1, if the license needs to be changed at runtime, use the method SetProductKeyAsync() instead.

UseLocalService

Syntax

/**
 * Return whether this WebTwain instance is in Local-Service mode or WASM mode.
 */
UseLocalService:boolean; 

Is this page helpful?

YesYes NoNo

In this article:

version 16.2

  • Latest Version
  • Version 17.2.1
  • Version 17.1.1
  • Version 17.0
  • Version 16.2
  • Version 16.1.1
Change +
© 2003–2022 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support