Customize the Dynamic Web TWAIN Object

Change the name of the object

By default, the (first) Dynamic Web TWAIN object is named DWObject. You should set it before using any properties or methods of Dynamic Web TWAIN. A good place to do this is the built-in function Dynamsoft_OnReady. For example, in our Hello World sample:

function Dynamsoft_OnReady() {
    DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');

The div with id dwtcontrolContainer is the placeholder for Dynamic Web TWAIN. Its initial name and size are defined in the file dynamsoft.webtwain.config.js as shown below. You can change it if necessary.


Change the Size of the Viewer

You can change the initial size of the container (the built-in viewer) in dynamsoft.webtwain.config.js. You can use either a number or a percentage here. For example

Dynamsoft.WebTwainEnv.Containers = [{ ContainerId: 'dwtcontrolContainer', Width: '50%', Height: '513px' }];


You can also change the size of the container at runtime using the properties Width and Height.

results matching ""

    No results matching ""

    results matching ""

      No results matching ""