I am developing a java application that can search my system and find all the scanners and lets me select if there are more than one scanner installed and proceed for scanning the document. I understand i should use twain for this. I have a library file in my system path but i have no idea how do i use this. Are there any sample programs on how to use this in my java application.
I have found the below sample code that uses WIA for communicating with the scanners. Is there any jar file to import to my netbeans or is there any other way out.
WIA.DeviceManager manager = new WIA.DeviceManagerClass();
string deviceName = "";
foreach (WIA.DeviceInfo info in manager.DeviceInfos)
{
if (info.Type == WIA.WiaDeviceType.ScannerDeviceType)
{
foreach (WIA.Property p in info.Properties)
{
if (p.Name == "Name")
{
deviceName = ((WIA.IProperty)p).get_Value().ToString();
Console.WriteLine(deviceName);
}
}
}
}