General Utilities

Methods
GetImagePartURL() GetImageURL() Print()
RegisterEvent() UnregisterEvent() SetLanguage()
Properties
BufferMemoryLimit ErrorCode ErrorString
IfAllowLocalCache IfShowProgressBar LogLevel
Manufacturer ProductFamily ProductKey
ProductName VersionInfo
Events
OnBitmapChanged

Methods

GetImagePartURL()
Gets the internal url of an image in buffer specified by index.
Syntax .GetImagePartURL(index);
Parameters number index: specifies the index of image in buffer. The index is 0-based.
Return value string
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v14.3.1 ✓ | v13.0 ✓ | v13.0 ✓ | v13.0 ✓ | v13.0
Usage notes The returned URL will be like "dwt://dwt_trial_13000404/img?id=306159652&index=0&t=1502184632022".
GetImageURL()
Gets the url of the new image resized from the image of a specified index in buffer.
Syntax .GetImageURL(index, [optional nWidth, optional nHeight]);
Parameters number index: specifies the index of image in buffer. The index is 0-based.
optional number nWidth: specifies the new width which should be no smaller than 150.
optional number nHeight: specifies the new height which should be no smaller than 150.
Return value string
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v12.0 ✓ | v12.0 ✓ | v12.0 ✓ | v12.1
Usage notes The returned URL will be like "http://127.0.0.1:18622/dwt/dwt_trial_14100828/img?id=780003506&index=0&t=1539674113432". If nWidth and nHeight are not specified, the original image will be returned.
Print()
Opens the print dialog of the browser to print images.
Syntax .Print()
Parameters boolean PrintOption: By default, it uses the browser print UI. If set it to true, it will open a separate process for the print operation.
Return value boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.0 ✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes Currently this method is only valid in Windows & Mac.
This method opens the browser print dialog to print documents. This dialog will appear in a new browser window. Typically it is blocked by the browser at the first time, you can choose to 'always allow' the dialog.
RegisterEvent()
Adds an event listener to a built-in Dynamic Web TWAIN event.
Syntax .RegisterEvent()
Parameters string eventName: the name of a built-in event.
Return value boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v9.2 ✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes For the same event, the 2nd listener will override the 1st one. So there is always just one event listener for one event.
UnRegisterEvent()
Adds an event listener to a built-in Dynamic Web TWAIN event.
Syntax .UnRegisterEvent(eventName,evt)
Parameters string eventName: the name of a built-in event.
Function evt: a function as the event listener.
Return value boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v9.2 ✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
SetLanguage()
Sets the language for the authorization dialogs.
Syntax .SetLanguage()
Parameters boolean PrintOption: By default, it uses the browser print UI. If set it to true, it will open a separate process for the print operation.
Return value boolean
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v13.0 ✓ | v13.0 ✓ | v13.0 ✓ | v13.0
Usage notes Available values are English: 0, French: 1, Arabic: 2, Spanish: 3, Portuguese: 4, German: 5, Italian: 6, Russian: 7, Chinese: 8

Properties

BufferMemoryLimit
Returns or sets how much physical memory (caching threshold) is allowed for storing images currently loaded in Dynamic Web TWAIN. Once the limit is reached, images will be cached on the hard disk.
Type number
Accessors Gets Set
Usage notes Set this property only when you have a very small physical memory (< 2GB) or a very big one (>4GB). The more memory is allowed, the better the performance will be.
The default value is set to 800 (MB), anything beyond 800MB gets compressed, encrypted and cached on the local disk.
All cached data is encrypted and can only be read by Dynamic Web TWAIN and it will be destroyed when it is no longer used.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v10.1 ✓ | v10.1 ✓ | v10.1 ✓ | v11.0 ✓ | v12.1
ErrorCode
Returns the error code.
Type number
Accessors Get
Usage notes Check out the Complete Error List
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v1.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
ErrorString
Returns the error string.
Type number
Accessors Get
Usage notes Check out the Complete Error List
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v1.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
IfAllowLocalCache
Returns or sets whether the feature of disk caching is enabled.
Type boolean
Accessors Get Set
Usage notes The default value of IfAllowLocalCache is true. When the property is true, you can scan as many images as you want as long as you have a big enough disk.
The default threshold is set to 800 (MB), anything beyond 800MB gets compressed, encrypted and cached on the local disk.
If neccessary, you can set the threshold using BufferMemoryLimit for better performance.
All cached data is encrypted and can only be read by Dynamic Web TWAIN and it will be destroyed when it is no longer used.
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v10.0 ✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
IfShowProgressBar
Returns or sets whether the progress bar is/should be displayed during encoding or decoding.
It works for any image encoding/decoding related methods. For example: LoadImage, LoadImageEx, ConvertToBlob, etc.
Type boolean
Accessors Get Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v8.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
LogLevel
Returns or sets the log level for debugging.
Type Number
Accessors Get, Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v6.3✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes The default value for LogLevel is 0 which means the extra information for debugging won't be logged. To log the information for debugging, you can set it to 1.
Manufacturer
Returns or sets the Manufacturer string for the application identity.
Type string
Accessors Get, Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v1.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes The Manufacturer property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo.
All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information be set prior to any other TWAIN functions. 
ProductFamily
Returns or sets the ProductFamily string for the application identity.
Type string
Accessors Get, Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v1.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes The ProductFamily property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo.
All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information be set prior to any other TWAIN functions. 
ProductKey
Returns or sets the ProductKey string for the application identity.
Type string
Accessors Get, Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v9.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes Each product key is generated with one or a set of licenses. It's not allowed to run your application which based on Dynamic Web TWAIN without a product key (the licenses).
ProductName
Returns or sets the ProductName string for the application identity.
Type string
Accessors Get, Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v1.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes The ProductName property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo.
All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information be set prior to any other TWAIN functions. 
VersionInfo
Returns or sets the VersionInfo string for the application identity.
Type string
Accessors Get, Set
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v1.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes The VersionInfo property is a part of the application identity. The application identity consists of the Manufacturer, ProductFamily, ProductName and VersionInfo.
All the application identity information should be set prior to invoking OpenSourceManager(). Since with built-in Wizard Mode, Dynamic TWAIN manages the transition of TWAIN state intelligently, OpensourceManager() may be called automatically by other TWAIN related functions, such as OpenSource() or AcquireImage(). It is recommended that application identity information be set prior to any other TWAIN functions. 

Events

OnWebTwainReady
This event is triggered as soon as Dynamic Web TWAIN is successfully loaded and initialized on the page.
Syntax Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady); function Dynamsoft_OnReady() {...}
or
Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', function() {...});
Arguments None
Example
Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);

function Dynamsoft_OnReady() {
    var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
    DWObject.Width = 270;  
    DWObject.Height = 350;    
    //Add event listeners to DWObject
    DWObject.RegisterEvent("OnPostTransfer", function(){...}); 
    DWObject.RegisterEvent("OnPostLoad", function(){...}); 
    DWObject.RegisterEvent("OnMouseClick", function(){...}); 
}
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v8.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1
Usage notes This is the best place to set up Dynamic Web TWAIN (change the size of it, add event listeners, etc.) as shown below in the example.
OnBitmapChanged
This event is triggered when the current image in buffer is changed like flipped, cropped, rotated, etc. or a new image has been acquired.
Syntax .RegisterEvent('OnBitmapChanged',function(){...});
Arguments None
Example
DWObject.RegisterEvent('OnBitmapChanged', function() {
    alert('image is changed');
});
Availability
ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
✓ | v8.0✓ | v10.0 ✓ | v10.0 ✓ | v11.0 ✓ | v12.1

results matching ""

    No results matching ""

    results matching ""

      No results matching ""