#1
Posted
:
Wednesday, July 22, 2015 1:26:17 AM(UTC)
Groups: Registered
Posts: 1
Hi,
Im trying de create an application using Leadtools twain fro scanning documents.
The application works fine with some scanners but i get an error with FUJITSU fj-6130 scanner
"2015-07-22 11:57:33.5982 ERROR Leadtools.RasterException: Invalid parameter passed
à Leadtools.Twain.TwainCapability.get_OneValueCapability()
à Automatic.Scan.UI.Custom.ScanForm._miFileAcquire_Click(Object sender, EventArgs e)
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
à System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
à System.Windows.Forms.Control.WndProc(Message& m)
à System.Windows.Forms.ButtonBase.WndProc(Message& m)
à System.Windows.Forms.Button.WndProc(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
à System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
à System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)"
this is the code where the exception is detected :
" try
{
config.ConfigType = ConfigFileType.WindowsService;
_twainSession.AcquirePage += new EventHandler(_twain_AcquirePage);
//INST: Scan des images
//INST : Vérification si le scanner est branché ou non
isOnline = new TwainCapability();
isOnline = _twainSession.GetCapability(TwainCapabilityType.DeviceOnline, TwainGetCapabilityMode.GetValues);
_twainSession.EnableGetDeviceEvent = true;
//INST: Verfier si le scanner contient du papier ou non
feederLoaded = new TwainCapability();
feederLoaded = _twainSession.GetCapability(TwainCapabilityType.FeederLoaded, TwainGetCapabilityMode.GetValues);
online = (bool)isOnline.OneValueCapability.Value;
loaded = (bool)feederLoaded.OneValueCapability.Value;
if (online)
{
btnRestart.Enabled = true;
if (loaded)
{
_twainSession.Acquire(TwainUserInterfaceFlags.Show);
_sbMain.Text = "Opération terminée.";
}
else
{
MessageBox.Show(this, "Il n'y a pas de papier dans le scanner!");
_sbMain.Text = "Erreur d'acquisition!";
}
}
else
{
MessageBox.Show(this, "Le scanner n'est pas connecté!");
_sbMain.Text = "Erreur d'acquisition!";
}
//INST: Retrait de l'evenement acquire
_twainSession.AcquirePage -= new EventHandler(_twain_AcquirePage);
MessageBox.Show("Le nombre pages scannées est: " + _saveFilesCount.ToString());
Thread ProcessScannedThread = new Thread(() => SplitImages(tempFileNameTiff));
ProcessScannedThread.IsBackground = true;
ProcessScannedThread.Start();
}
catch (TwainException ex)
{
throw ex;
} "
Should i chage the driver of the scanner or change same code ?
Please HELP me
#2
Posted
:
Wednesday, July 22, 2015 6:28:52 AM(UTC)
Groups: Registered, Tech Support
Posts: 179
I sent you a reply regarding this issue in Ticket number 2015072210000239 . If you have questions or comments, please reply to that email.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.