ImageGear .NET v25.1 - Updated
Multi-stream Scanning
User Guide > How to Work with... > Common Operations > Scanning > Web-Based Scanning > Multi-stream Scanning

Some scanners come with a feature called "multi-stream" or "dual-stream". This feature allows you to scan a page once, but retrieve multiple versions of the scanned page (e.g., colored and grayscale). To use this feature, you must set the scanner to the required mode and acquire the scanned page sequentially using the ImageGear .NET Web API.

If there is a single page in the scanner, the scanner is set to "multi-stream" mode and is expected to send a colored and a grayscale image; you can get both images by executing the following:

C#
Copy Code
// This is stripped boiler-plate code. Take a look at ImgearIsisSample.js in the IsisScanningUsingASP.NET Demo for more complete code.
var scannerService = new ImageGear.Web.Isis.ImGearIsisScannerService();
var scannerSession;
scannerService.createSession({ applicationName: "ImGearTestsample", destroyExistingSession: true, locale: "en-us", idleTimeoutMinutes: 0, callback: createSessionCallback });
function createSessionCallback(theScannerSession, status) {
    scannerSession = theScannerSession;
}
function pageRetrievedCallback(result, status) {
    // do something with scanned page
}
// Will trigger pageRetrievedCallback 2 times
scannerSession.scan({ pages: 1,
    scanDataType: ImageGear.Web.Isis.ImGearIsisScanDataType.Base64Page,
    fileFormat: fileFormat,
    pageRetrievedCallback: pageRetrievedCallback,
    documentRetrievedCallback: documentRetrievedCallback
});