VintaSoft Twain .NET SDK Discussions
Questions, comments and suggestions concerning VintaSoft Twain .NET SDK.
Board index < VintaSoft Twain < VintaSoft Twain .NET SDK Discussions
function setUnitOfMeasureAndResolution(openedDevice, unitOfMeasure, resX, resY) {
// success callback
function __success(data) {
// capability
var capability = data.capability;
// new value of capability
var newValue = capability.currentValue.value;
// log information about new value
console.log("Capability '" + capability.name + "' new value - " + newValue);
}
// error callback
function __error(data) {
// message
var message = "";
// if capability exists
if (data.capability != undefined)
// add information about capability name
message += "Capability '" + data.capability.name + "':";
// add information about error
message += data.errorMessage;
// show message
alert(message);
}
// change unit of measure
openedDevice.setCapability(new Vintasoft.Twain.WebDeviceCapabilityIdJS("IUnits"), unitOfMeasure, __success, __error);
// change horizontal resolution
openedDevice.setCapability(new Vintasoft.Twain.WebDeviceCapabilityIdJS("IXResolution"), resX, __success, __error);
// change vertical resolution
openedDevice.setCapability(new Vintasoft.Twain.WebDeviceCapabilityIdJS("IYResolution"), resY, __success, __error);
}
Also please see code of Twain Device Capabilities dialog in source codes of AspNetMvc5Demos project:Hi,Hi Alex, I can't seem to set the capability value. When I do what is described, nothing happens. Any idea what my problem may be?
I'm having some troubles so I thought I could reach * for some help.
I've been using theTWAIN .NET SDK product on a ASP.NET MVC project using the
ASP.NET MVC + HTML5 approach (using Local Service) and I'm having some troubles with
the scanning process.
If I choose to scan using the Scanner native UI, I have always the preview tool and I always
have the chance to define the scan area. Our scanner allows to scan documents up to A3 size.
Still, when I try to scan documents withou the scanner UI, it seems that the documents are
always scanned in the A4 portrait size; therefore if I try to scan a document in A4 landscape
or A3, it will always end up being cropped.
I can't seem to set the capability value. When I do what is described, nothing happens. Any idea what my problem may be?I have updated the example in previous post. Also we added example to documentation: https://www.vintasoft.com/docs/vstwain- ... ility.html