Hello,
I have purchased Vintasoft.NET Twain SDK and testing your examples.
I try modifying above example with new request (despeckle, deskew and detect border) which I
found in help, but don't know how can implement in this example.
Can you help me with this?
Best regards,
Sasa
Help with web TWAIN demo
Moderator: Alex
Re: Help with web TWAIN demo
Hello Sasa,
You should get a reference to acquired image object, for example as follows - device.AcquiredImages[0], and call Despeckle, Deskew, etc methods of the AcquiredImage class.
Best regards, Alexander
You should get a reference to acquired image object, for example as follows - device.AcquiredImages[0], and call Despeckle, Deskew, etc methods of the AcquiredImage class.
Best regards, Alexander
Re: Help with web TWAIN demo
Hello Alex,
I have no luck, please I need urgent help.
I changed this code in markup of .aspx page, but this not work:
What I missing?
Where I must put "Vintasoft.Twain.dll" in ASP.NET (I put in root of my web application)?
Can I put this .dll in "Bin" folder?
Best regards,
Sasa
I have no luck, please I need urgent help.
I changed this code in markup of .aspx page, but this not work:
Code: Select all
<script language="JavaScript" type="text/javascript">
function StartScan()
{
// check that DeviceManager1 object is initialized properly
if (DeviceManager1.IsTwainAvailable == null)
{
document.getElementById('ErrorString').innerHTML = "<a href=http://www.vintasoft.com/vstwain-dotnet-faq.html#Web_DotNetSecurityError>Click here to see how to set the .NET Framework Security settings</a>";
alert("Your .NET Framework Security settings must be configured to run the components in your browser.");
return;
}
document.FormHttp.ScanImagesButton.disabled = 1;
var imageCounter = 0;
try
{
// open the data source manager
DeviceManager1.Open();
// select the device
if (DeviceManager1.Devices.Select())
{
// get a reference to current device
var device = DeviceManager1.Devices.Current;
// enable/disable the User Interface of device
device.ShowUI = document.FormHttp.ShowUI.checked;
// store only one image in the internal buffer of device
device.AcquiredImages.Capacity = 1;
// gray
// open the device
device.Open();
device.PixelType = 0;
try
{
// specify how many images application wants to get from the device
if (document.FormHttp.ScanAll.checked == false)
device.XferCount = 1;
else
device.XferCount = -1;
}
catch (ex)
{
}
// enable document feeder if necessary
if (device.IsFeederPresent)
{
try
{
device.DocumentFeeder.Enabled = document.FormHttp.Adf.checked;
}
catch (ex)
{
alert("Feeder cannot be enabled or disabled.");
}
}
// acquire image(s) from the device
var acquireModalState;
var acquiredImage;
var acquireStatusString = "Scan canceled";
do
{
acquireModalState = device.AcquireModal();
// image acquired
if (acquireModalState == 2)
{
// upload acquired image to the server
acquiredImage = device.AcquiredImages.Last;
acquiredImage = acquiredImage.Despeckle(8,25,30,400);
acquiredImage = acquiredImage.Deskew(0, 5, 5);
acquiredImage = acquiredImage.DetectBorder(5);
imageCounter = imageCounter + UploadToHttpServer(acquiredImage);
}
// scan completed
else if (acquireModalState == 3)
acquireStatusString = "Scan completed";
// scan failed
else if (acquireModalState == 4)
acquireStatusString = "Scan failed";
// scan canceled
else if (acquireModalState == 5)
acquireStatusString = "Scan canceled";
}
while (acquireModalState != 0)
}
}
catch (ex)
{
alert(ex.message);
}
finally
{
// disable the device if device is enabled
if (device.State == 2)
device.Disable();
// close the device if device is opened
if (device.State == 1)
device.Close();
// scan process is finished
alert(acquireStatusString + ": " + imageCounter + " images are uploaded onto the server.");
document.FormHttp.ScanImagesButton.disabled = 0;
}
}
</script >
Where I must put "Vintasoft.Twain.dll" in ASP.NET (I put in root of my web application)?
Can I put this .dll in "Bin" folder?
Best regards,
Sasa
Re: Help with web TWAIN demo
Thank you for solution.
You can mark topic as solved.
You can mark topic as solved.