|
PixTools for .NET: Enabling Auto Feeder Detect
| March 2008 | |
| Contributed by - Kirill Vanyukov |
Abstract
This article gives a brief overview of scanner feature Automatic Feeder Detection.
Automatic Feeder Detection
How does it work? When you scan with Automatic Feeder Detection enabled, the scanner will check if the document feeder is empty and scan from the flatbed.
Some scanners have a sensor inside the document feeder which will detect the presence of paper and if necessary draw paper in.
Scanning from both the Document Feeder and the Flatbed
As you can see from the above diagram the scanner always tries to scan from both feeders.
Even if the scanner scans a few pages from the document feeder it will also scan from the flatbed.
Usually this is not the expected behavior.
Most users would like to scan from the document feeder until it is empty. And if necessary scan from the document flat bed.
This is illustrated below.
PixTools for .NET
The sample below shows how to implement this behavior using PixTools for .NET.
The Code
ScanDriver Scanner = ScanDriverManager.GetDriver("some scanner driver");
PageSide pageSide = null;
bool AutoFeeder = false;
if( PixScanType.Automatic == Scanner.ScanSource )
{
Scanner.ScanSource.Value = PixScanType.Feeder;
AutoFeeder = true;
}
using (ToPixImageDriver toPixImage = new ToPixImageDriver())
using (PipeProcess process = new PipeProcess(this.m_ScanDriver, toPixImage))
{
while (true)
{
try
{
// Run scan process
pageSide = process.Run();
}
catch (PixFeederEmptyException)
{
// Exit scan process if there are no pages in feeder
break; // Exit scan process
}
catch (PixException exception)
{
MessageBox.Show(exception.Message, this.Text);
break; // Break scan process
}
}
if(null == pageSide)
{
Scanner.ScanSource.Value = PixScanType.Flatbed;
try
{
pageSide = process.Run();
}
catch (PixException exception)
{
MessageBox.Show(exception.Message, this.Text);
}
}
}
if(true == AutoFeeder)
{
Scanner.ScanSource = PixScanType.Automatic;
}
|
About the Author
Kirill Vanyukov is the senior software engineer for the PixTools technology group.
He graduated St. Petersburg State Transport University.
He worked for Aelita Software Corporation (it is a part of Quest Software Corporation now) before coming to EMC Captiva.
Mr. Vanyukov has deep experience with all PixTools products and participated in PixTools for .NET project from the beginning to the end.
Click here to discuss this article
|