Dev Center
Scenario When using Dynamic Web TWAIN in different environments, it may be necessary to change the size of the viewer within the window automatically.
Steps This can be done in two different ways
For option 1: You may change the container size based on the window size by setting the following in your javascript file (before any other Dynamsoft-related operations):
Dynamsoft.DWT.Containers = [
{
ContainerId: "dwtcontrolContainer",
Width: window.innerWidth,
Height: window.innerHeight,
},
];
and in dynamsoft.webtwain.config.js file set:
Dynamsoft.DWT.Containers = [];
Note: window.innerWidth and window.innerHeight do not work in IE. You can replace it with document.documentElement.clientWidth and document.documentElement.clientHeight.
For option 2:
Write your own function to calculate the Container’s width and height according to the browser’s size. Then, assign the values to our API’s Height & Width. Finally, use the event resize to trigger the function.
latest version