Duplex ADF scanning returning 2 of the first side only on HP ScanJet Enterprise Flow 5000 scanner
Posted: Thu Jul 22, 2021 7:54 pm
We are experiencing an issue where the method TwainAcquireToGdPictureImage returns 2 pages but each of only the first side of a two sided document when scanning using Duplex on the HP ScanJet Enterprise Flow 5000 s4 ADF scanner. This is not an issue on other scanners with duplex scanning, but is a consistent one for this HP scanner. I have opened a ticket with you all but was hoping maybe to either see if there is a known issue or at least have it documented incase others experience this aswell. Below is the code we are using:
Code: Select all
using (GdPictureImaging gdpi = new GdPictureImaging())
{
if (TWAINDSMLocation.Length > 0)
{
gdpi.TwainSetDSMPath(TWAINDSMLocation);
}
if (gdpi.TwainOpenDefaultSource(0))
{
gdpi.TwainSetHideUI(!displayScannerOptions);
gdpi.TwainSetAutoFeed(true);
gdpi.TwainSetAutoScan(true);
do
{
// acquire initial page
imageID = gdpi.TwainAcquireToGdPictureImage(0);
if (imageID != 0)
{
pageCount++;
if (pageCount == 1)
{
// if first page, create multipage file on disk
multiPageID = imageID;
gdpi.TiffSaveAsMultiPageFile(imageID, localFileName, compression);
}
else
{
// add subsequent pages to multipage file
gdpi.TiffAddToMultiPageFile(multiPageID, imageID);
gdpi.ReleaseGdPictureImage(imageID);
}
}
} while (gdpi.TwainGetState() > TwainStatus.TWAIN_SOURCE_ENABLED);
gdpi.TwainCloseSource();
gdpi.TiffCloseMultiPageFile(multiPageID);
gdpi.ReleaseGdPictureImage(multiPageID);
}