In some cases, you may want to scan only part of the information of the picture. At this time, Dynamic Web TWAIN will be able to fulfill the demand.
Dynamic Web TWAIN provides an interface called SetImageLayout , you can determine the portion of the image to be scanned by this method.
Sample code:
function scanImage() {
var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
if (DWObject) {
DWObject.SelectSource();
DWObject.OpenSource();
DWObject.IfShowUI = false;
DWObject.Unit = EnumDWT_UnitType.TWUN_INCHES;
DWObject.SetImageLayout(0, 0, 5, 5);
DWObject.AcquireImage();
}
}
If you know the page size such as A4, USLEGAL, etc., may be used PageSize this property.
function scanImage() {
var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
if (DWObject) {
DWObject.SelectSource();
DWObject.OpenSource();
DWObject.IfShowUI = false;
DWObject.PageSize = EnumDWT_CapSupportedSizes.TWSS_USLEGAL;
DWObject.AcquireImage();
}
}