Home : WingScan : Change WingScan Scanning Options Between Scans
Q10385 - HOWTO: Change WingScan Scanning Options Between Scans

This article covers how to change WingScan scanning options between scans. This will allow you to scan different DPI/Pixel Type/Duplex most scan settings between scans. You can provide a custom user interface for the end user to select options or provide pre-defined option sets.

Please note that the full WingScan API is now documented online

Versions of DotImage/WingScan prior to 10.6 will find the documentation in the DevelopersGuide pdf that comes with the product... for 10.6 and 10.7, the full WingScan API is in

C:\Program Files (x86)\Atalasoft\DotImage 10.6\bin\WebResources\WebCapture\WingScan API Reference.pdf
C:\Program Files (x86)\Atalasoft\DotImage 10.7\bin\WebResources\WebCapture\WingScan API Reference.pdf

This guide assumes you have a working WingScan project and have set some number of scanning options within your scanningOptions parameter when instantiating your WingScan plugin, ex:

     handlerUrl: 'TestCaptureHandler.ashx',
     /* Any additional event handlers */
     scanningOptions: { applyVRS: true, resultPixelType: Atalasoft.Controls.Capture.PixelType.BW, duplex: true, discardBlankPages:true }

That will apply VRS, return black and white images, capture duplex (two sided scanning) and discard blank pages.

Note, all of these properties are covered in the WingScan API Reference.pdf
which is installed along with the SDK in 10.6 and 10.7 and for 11.0 and newer is available online at https://atalasoft.github.io/web-capture-service/

So, specifically what we're going to cover is how to change those between scans without relying on the initial scanningOptions. That scanningOptions object passed in to the initialize call is a standard JavaScript object. It is available through Atalasoft.Controls.Capture.WebScanning.scanningOptions.

If you wanted to change the resultPixelType from PixelType.BW (black and white) to PixelType.Color it would be as simple as running a bit of JavaScript:
Atalasoft.Controls.Capture.WebScanning.scanningOptions.resultPixelType = Atalasoft.Controls.Capture.PixelType.Color;

Changing the DPI between scans (which again, the properties exposed in the scanningOptions map to the definitions in the Developer Guide) is as simple as:
Atalasoft.Controls.Capture.WebScanning.scanningOptions.dpi = 300;

Changing the PageSize between scans (which again, the properties exposed in the scanningOptions map to the definitions in the documentation) is as simple as:
Atalasoft.Controls.Capture.WebScanning.scanningOptions.PaperSize= Atalasoft.Controls.Capture.PaperSize.USLetter;

You can bind the script to any standard HTML element:
<input type="button" title="High quality" value="High quality" onclick="Atalasoft.Controls.Capture.WebScanning.scanningOptions.dpi = 300; return false;" />
<input type="button" title="Medium quality" value="Medium quality" onclick="Atalasoft.Controls.Capture.WebScanning.scanningOptions.dpi = 200; return false;" />

As mentioned, you can set any number of properties at the same time:
function setScanningForInvoices()
 var options = Atalasoft.Controls.Capture.WebScanning.scanningOptions;
 options.applyVRS = true;
 options.dpi = 300;
 options.resultPixelType  = Atalasoft.Controls.Capture.PixelType.BW;
 options.duplex = true;
 options.discardBlankPages = true;
 options.deskew = true;
 options.autoRotate = true;
 return false;

function setScanningForFlyers()
 var options = Atalasoft.Controls.Capture.WebScanning.scanningOptions;
 options.applyVRS = false;
 options.dpi = 200;
 options.resultPixelType  = Atalasoft.Controls.Capture.PixelType.Color;
 options.duplex = false;
 options.discardBlankPages = true;
 options.deskew = false;
 options.autoRotate = true;
 return false;

What I'm getting at here is that you can customize how you change these settings depending on the needs your application and end-users. If you have a drop down of different document types with different settings or you limit them to "High", "Medium", and "Low" is up to you and how you identified your needs.

Related Articles
No Related Articles Available.

Article Attachments
No Attachments Available.

Related External Links
No Related Links Available.
Help us improve this article...
What did you think of this article?


Tell us why you rated the content this way. (optional)
Approved Comments...
No user comments available for this article.

Powered By InstantKB.NET v1.3
Copyright © 2002, 2020. InstantASP Ltd. All Rights Reserved