Resources Base
Table of contents


Global properties and functions.

interface Dynamsoft.DWT {
    readonly licenseServer: string [];
    readonly organizationID: string;
    readonly handshakeCode: string;
    readonly sessionPassword: string;
    readonly licenseException: string;
    readonly ActiveXVersion: string;
    readonly JSVersion: string;
    readonly PdfVersion: string;
    readonly ServerLinuxVersionInfo: string;
    readonly ServerMacVersionInfo: string;
    readonly ServerVersionInfo: string;
     * Whether to create a WebTwain instance automatically.
    AutoLoad: boolean;
    ContainerMap: object;
     * Define the Id and UI of the WebTwain instances.
    Containers: Container[];
    Host: string; //""
    IfAddMD5InUploadHeader: boolean;
    IfDisableDefaultSettings: boolean;
    IfUseActiveXForIE10Plus: boolean;
    readonly inited: boolean;
    ProductKey: string;
    ResourcesPath: string;
    UseLocalService: boolean;
    UseDefaultInstallUI: boolean;
    // Functions
        ContainerId: string, 
        host?: string, 
        port?: string | number, 
        portSSL?: string | number, 
        asyncSuccessFunc: function (DWObject: WebTwain) {}, 
        asyncFailureFunc: function (errorString: string) {}
    ): void;
        dwtInitialConfig: DWTInitialConfig,                 
        asyncSuccessFunc: (DWObject: WebTwain) => {},                   
        asyncFailureFunc: (errorString: string) => {}
    ): void;
    DeleteDWTObject(Id?: string): boolean;
    GetWebTwain(ContainerId?: string): WebTwain;
    GetWebTwainEx(WebTwainId: string): WebTwain;
    Load(): void;
    Unload(): void;
    RemoveAllAuthorizations: function () {};
    OnWebTwainNotFound: function () {};
    OnWebTwainPostExecute: function () {};
    OnWebTwainPreExecute: function () {};
    OnWebTwainReady: function () {};
    OnWebTwainWillInit: function () {};

License Server properties



 * Specify by URL the license server from where authorization is acquired at runtime.
licenseServer: string [];


Dynamsoft.DWT.licenseServer = ["", ""];

Usage notes

Gets or sets the URL of the license tracking server used to authenticate the license (handshakeCode) and track barcode reading usage. When set to null (default value), it will connect to Dynamsoft’s license tracking servers for online verification. A self hosting option is available. Learn more about License Tracking Server 2.0.



 * Get or set the organization ID. 
organizationID: string;


Dynamsoft.DWT.organizationID = "123456"; // replace the number 123456 with YOUR-ORGANIZATION-ID

Usage notes

Check out more on how to specify the Organization ID



 * Gets or sets the handshake code to interact with the license server(s).
handshakeCode: string;


Dynamsoft.DWT.handshakeCode = "1000**601-1000***44";

Usage notes

Learn more about What is handshakeCode



 * Gets or sets the session password of the handshake code set in Dynamsoft License server.
handshakeCode: string;


Dynamsoft.DWT.sessionPassword = "MyPassw0rd";

Usage notes Learn more about session password in Dynamsoft License server.



 * Error message related to license.
licenseException: string;

Usage notes

Check license error list



An array of Container definitions that specifies the UI elements for WebTwain instances. The Container interface is defined below

interface Container {
    WebTwainId: string, // Id of the WebTwain instance
    ContainerId?: string, // Id of the element
    Width?: string | number, // Width of the element
    Height?: string | number // Height of the element


Whether or not an md5 header dwt-md5 should be included in HTTP upload requests. Note that this header is not a standard header and may be deemed invalid on some web servers.

The default value is false .


Sets or returns the product key for the library. A product key is required to enables certain modules of the library.


Sets or returns where the library looks for resources files including service installers, CSS, etc.


Sets or returns whether to use the service or use WASM only. This property can be changed at runtime (but not recommended) and affects WebTwain instances created after the change.

The default value is true .



Creates a new WebTwain instance that listens to the specified host & ports. An UI element specified by the parameter ContainerId which is typically a <div> is required. The library will generate a UI and bind it to this element.


Creates a new UI-less WebTwain instance. This instance will be uniquely identified by the parameter WebTwainId .

  interface DWTInitialConfig {

      WebTwainId: string,
          Host ? : string,
          Port ? : string,
          PortSSL ? : string



Delete the WebTwain instance specified by Id which can either be a ContainerId or a WebTwainId .


Gets an WebTwain instance by its ContainerId .


Gets an WebTwain instance by its WebTwainId .


Initiates the library. If there are predefined Containers , one WebTwain instance will be created for each Container .


Registers an environmental event. Typically the event is OnWebTwainReady which is triggered when the initialization completes.


Destroys all WebTwain instances and cuts off the connection to the Dynamsoft Service.


Removes the specific authorizations made by end users on a client machine. Only effective when the security feature is enabled for local files, scanners or cameras.


Whether to use the built-in viewer. If it is set to false , the file dynamsoft.viewer.js is not loaded at all and there is no way to add it back later. Therefore, only set it to false when you absolutely won’t need the viewer or will be building your own viewer.


Use this API to customize the UI.


Specify the error messages.


Specify general messages.


Specify text on progress bars.


Specify the titles and whether to show one or multiple buttons on the image editor.


Specify the text on dialogs.


Specify the source of the loader bar image. Check out more on HTMLImageElement.src.


Specify the class name of the DIV element that contains the loader bar. With this class, you can customize the loader bar even further with CSS.



Specify the maximum memory allowed to be used by the library when it’s in WASM-mode. By default, it’s 200 (MB).


  • headers

A Headers object, an object literal, or an array of two-item arrays to set request’s headers. Check out HeadersInit.

  • mode

A string to indicate whether the request will use CORS, or will be restricted to same-origin URLs. Sets request’s mode. Check out RequestMode.

  • credentials

A string indicating whether credentials will be sent with the request always, never, or only when sent to a same-origin URL. Sets request’s credentials. Check out RequestCredentials.

Is this page helpful?

YesYes NoNo

In this article:

latest version

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