ScanningOptions

Various options that control scanning operations.

Properties:
Name Type Default Description
barcodes object

This scanning option controls barcode recognition during scanning. The results are available in the barcodes property on each image delivered to the onImageAcquired handler.

Atalasoft.Controls.Capture.WebScanning.scanningOptions = {
  barcodes: { count: 1, symbology: [ 'Code 39', 'Code 128' ]
}
// ...
function _onImageAcquired(event, imageProxy) {
  if (imageProxy.barcodes.length > 0) {
    // process barcodes
    alert('first barcode type=' + imageProxy.barcodes[0].symbology +
          ', data='+imageProxy.barcodes[0].data);
  }
}

To enable barcode recognition, include barcodes as a property of the scanningOptions object, and set it to an object with one or more of the following properties:

Property Type Meaning If omitted
count integer maximum number of symbols to recognize -1, meaning 'all'
checksums boolean whether to check & strip optional checksums. Not supported by Web Capture Service for macOS. false
symbology string[] names of symbologies to recognize (see below) all

Supported symbologies:

  • EAN-13
  • EAN-8
  • UPC-A
  • UPC-E
  • Code 39
  • Code 39 (Full ASCII) (Not supported by Web Capture Service for macOS)
  • Code 128
  • Interleaved 2 of 5 (Not supported by Web Capture Service for macOS)
  • Codabar
  • Code 93 (Not supported by Web Capture Service for macOS)
  • Aztec (Not supported by Web Capture Service for macOS)
  • POSTNET
  • PDF417
  • Data Matrix
  • QR Code
  • MicroPDF417 (Not supported by Web Capture Service for macOS)
  • Micro QR Code (Not supported by Web Capture Service for macOS)
evrsSettings string

Settings can be loaded into EVRS for use in post-processing scanned images, by adding the property evrsSettings as a scanning option. The value of this property, if present, must be a string containing a valid XML-style EVRS operation string.

This option has effect only when applyVRS is true. If applyVRS is false the evrsSettings string is ignored.

This option can be used to set the effective value of any EVRS parameter, overriding any default value or value normally used by WingScan/WebCapture.

Any command/operation included in this string will cause EVRS to ignore any competing scanning options, as described in the following table:

EVRS command Ignored options
Do90DegreeRotation autoRotate
DoBarcodeDetection patchCodes
DoBinarization resultPixelType
DoBlankPageDetection discardBlankPages
DoColorDetection resultPixelType
DoCropCorrection autoCrop
DoEnhancedBinarization resultPixelType
DoGrayOutput resultPixelType
DoSkewCorrectionAlt deskew
DoSkewCorrectionPage deskew

Here is an example of setting EVRS options:

Atalasoft.Controls.Capture.WebScanning.initialize({
  // ...
  scanningOptions: { evrsSettings:
    '_Do90DegreeRotation_2' +
    '_DoGrayOutput_' +
    '_LoadSetting_<PropertyName="CBinarize.Do_Adv_Clarity.Bool" Value="1" Comment="DEFAULT 0"/>'
  },
  // ...
}
imageAddress ImageAddress

Allows to switch image indexing format to "Image Address" mode and set initial image address value.

At the moment "Image Address" is supported only by couple scanners in Kodak product line. template property is read-only and ignored when applying scanner configuration. Its value is only valid in scope of {Atalasoft.Controls.Capture.WebScanning.getSupportedValues|getSupportedValues} call.

imprintersConfig ImprintersConfig

Allows to configure scanner's imprinter devices.

Note: This option is not supported by Web Capture Service for macOS.

kofaxVRSEliteProfileName string

Specifies the name of VRS Elite profile which is supposed to be used, during scan using VRS.

Note: This option is not supported by Web Capture Service for macOS.

If the profile name is not defined, default profile is used during scan. If the specified profile does not exist, previously selected profile is used.

This option has effect only in case of using VRS for scan.

scanner string

Specifies the name of the scanner to use.

Default value: The last scanner selected in the scanner list control. If no scanner has been selected or there is no designated scanner list control, the user's default scanner is used.

This option is ignored by importFiles.

showScannerUI boolean false

Show (true) or hide (false) the scanner's user interface during scanning.

Note: This option is not supported by Web Capture Service for macOS.

This option is ignored by importFiles.

showScannerUIWithCurrentSettings boolean false

Show (true) or hide (false) the scanner's user interface during scanning. If this property is used instead of showScannerUI WebCapture Service does not set any scanner related settings to the scanner before show the scanner's user interface.

Note: This option is not supported by Web Capture Service for macOS.

This option is ignored by importFiles.

threshold number -1

This scanning option specifies the threshold to be used when scanning to B&W (bitonal) images.

Note: This option is not supported by Web Capture Service for macOS.

The value range is -1 to 255. The threshold value T is applied roughly as follows:

A value of -1 means 'let the scanner choose the threshold'

Imagine that each pixel of the document is measured as 8-bit grayscale to give a value V, with 0=black and 255=white. In the returned bitonal image, that pixel is returned as white if V > T, and as black if V < T. If V == T, it may be returned as black or as white, depending on the scanner.

Notes:

  1. Almost all scanners support this.
  2. This setting only has an effect when scanning with pixelType = 0 (B&W).
[importEDocs] false

indicates whether arbitrary files are available on importFiles call.

[applyVRS] boolean true

Enable or disable VRS post-processing in general.

If you specify applyVRS: false, VRS is not used for any post-processing.

If you specify applyVRS: true then the following options are set by default (i.e. if you do not specify them)

Property Value
pixelType 2 (Color)
resultPixelType 0 (B&W)
deskew true
autoRotate true
discardBlankPages false
[autoRotate] boolean true

Detect the orientation of the text in an image - right-side up, upside-down, sideways - and rotates the image so the text is upright.

Default value: true if VRS is enabled (applyVRS). If VRS is disabled, autoRotate is always disabled.

[brightness] number 0

This scanning option specifies how the brightness of scanned images should be adjusted by the scanner.

Note: This option is not supported by Web Capture Service for macOS.

Following TWAIN convention, the value range is -1000 to +1000.

Value Meaning
-1000 reduce brightness as much as possible
-1000 < n < 0 reduce brightness
0 do not adjust brightness
0 < n < 1000 increase brightness
+1000 increase brightness as much as possible

Notes:

  1. Not all scanners support this.
  2. For some scanners, not all values are distinguished: -500 may have the same effect as -501 or -499.
  3. Some scanners will ignore this value when scanning B&W.
  4. This option is ignored during importFiles.
[contrast] number 0

This scanning option specifies how the contrast of scanned images should be adjusted by the scanner.

Note: This option is not supported by Web Capture Service for macOS.

Following TWAIN convention, the value range is -1000 to +1000.

Value Meaning
-1000 reduce contrast as much as possible
-1000 < n < 0 reduce contrast
0 do not adjust contrast
0 < n < 1000 increase contrast
+1000 increase contrast as much as possible

Notes:

  1. Not all scanners support this.
  2. For some scanners, not all values are distinguished: -500 may have the same effect as -501 or -499.
  3. Some scanners will ignore this value when scanning B&W.
  4. This option is ignored during importFiles.
[deliverables] Deliveralbes

Specifies configurations for pre-generated data that should be prepared for each scanned image right after it's scanned.

[deskew] boolean true

Deskew is scanning jargon for 'straighten' - to rotate the scanned image by a few degrees to correct for the paper being scanned slightly crooked. This is not the same as autoRotate.

Default value: true if applyVRS is true, false otherwise.

[despeckle] boolean false

Scanning option indicating whether 'despeckle' filter is applied to the acquired image

[disableVRSIfInstalledOnWorkstation] boolean false

If this property is true, automatically disable VRS processing if VRS is detected on the client workstation. The idea is that if VRS is detected on the workstation, the user is probably using a VRS-equipped TWAIN driver, so there is no need to apply VRS processing twice to each image.

Note: This option is not supported by Web Capture Service for macOS.

Default value: false

[discardBlankPages] boolean false

When this option is true, blank images are detected and discarded during scanning. In duplex scanning, front and back sides of pages are discarded independently.

onImageAcquired is not fired for such discarded images.

[dpi] number 200

Controls the scanning resolution. It stands for dots per inch. It would be very unusual to find a scanner that doesn't support 100, 200 and 300 DPI. 150 DPI is almost as widely supported. Nearly all flatbed scanners can scan anything from 50 DPI to 1200 DPI.

The units of this value are always dots per inch, even if the computer, user account or browser are configured for a metric locale.

This option is ignored during importFiles.

[duplex] ScanMode Simplex

Controls duplex/simplex scanning. All scanners support simplex scanning. Many scanners with an ADF (Automatic Document Feeder) can scan duplex, but many cannot.

This option is ignored during importFiles.

[feeder] FeederType Any

This option selects between the ADF (Automatic Document Feeder) and the flatbed/glass AKA the platen.

This option is ignored by importFiles.

[holeFill] boolean false

Scanning option indicating whether 'hole fill' filter is applied to the acquired image

[autoCrop] boolean false

Scanning option indicating whether 'auto crop' filter is applied to the acquired image

[jpeg] object

Jpeg images compression settings.

[quality] number 75

Jpeg compression quality

[maxPages] number -1

Requests that the scanner scan no more than the specified number of pages. It defaults to -1, meaning 'no limit'. Set to 1 to scan a single page.

Note: this means physical pages - if scanning in duplex, maxPages:1 tells the scanner to send 2 images. Not all scanners can do this! Numerous Kodak models always scan everything in the hopper once you start them.

This option is ignored by importFiles.

[orientation] number Any

This parameter tells the scanner the expected orientation of the paper being fed, in the sense of upright (short edge feed) or sideways/landscape (long edge feed).

This option is ignored by importFiles.

[paperSize] PaperSize USLetter

Set the paper size being fed into the scanner.

Default value: USLetter (8.5" x 11.0", US Letter)

[patchCodes] boolean false

When set true, patch codes are detected and the results are available on each image delivered to the onImageAcquired handler.

[pixelType] PixelType Any

Defines the pixel format for scanning.

Every scanner capable of scanning paper documents can scan in Black & White (B&W) mode. Almost all scanners can scan grayscale and color. Many scanners, but certainly not all, can scan indexed color.

Note: We recommend using resultPixelType to control pixel format.

This option is ignored by importFiles.

[resultPixelType] PixelType Any

This specifies the pixel format you want delivered to your application after scanning or importing, and post-processing.

This is distinct from the pixelType parameter, which controls the pixel format requested from the scanner.

The pixel format used for scanning is:

  1. pixelType if specified
  2. otherwise if resultPixelType is specified, the Default Scan listed in the tables below
  3. otherwise if applyVRS is true then Color
  4. otherwise: B&W

Scan with applyVRS = true

resultPixelType Default Scan Result
PixelType.Auto Color B&W and grayscale => BW; All color => BW or RGB24, chosen by VRS
PixelType.Any (default) Color All => BW (binarized by VRS)
PixelType.BW Color All => BW
PixelType.Grayscale Grayscale B&W => BW; All other => Gray8
PixelType.Color Color B&W => BW; All grayscale => Gray8; All color => RGB24

Scan with applyVRS = false

Note that when VRS is disabled, resultPixelType can be effectively used in place of pixelType to control the scanner.

resultPixelType Default Scan Result
PixelType.Auto Color B&W => BW; All grayscale => Gray8; All color => RGB24
PixelType.Any (default) Color B&W => BW; All grayscale => Gray8; All color => RGB24
PixelType.BW Color All => BW
PixelType.Grayscale Grayscale B&W => BW; All other => Gray8
PixelType.Color Color B&W => BW; All grayscale => Gray8; All color => RGB24

Import with applyVRS = true

resultPixelType Effect of import
PixelType.Auto B&W and grayscale => BW; Color => BW or RGB24, chosen by VRS
PixelType.Any (default) All => BW (binarized by VRS)
PixelType.BW All => BW
PixelType.Grayscale B&W => BW; All other => Gray8
PixelType.Color B&W => BW; All grayscale => Gray8; All color => RGB24

Import with applyVRS = false

resultPixelType Effect of import
PixelType.Auto B&W => BW; all grayscale => Gray8; all color => RGB24
PixelType.Any (default) B&W => BW; all grayscale => Gray8; all color => RGB24
PixelType.BW All => BW
PixelType.Grayscale B&W => BW; All other => Gray8
PixelType.Color B&W => BW; All grayscale => Gray8; All color => RGB24
[scanCompression] number Auto

This parameter instructs the scanner whether scanned images should be compressed during scan. This parameter should be set to Enable when the scanner is confired to produce color or greyscale images only. Otherwise it should be disabled. It is strongly recommended to use Auto, incorrect value may lead to unexpected behaviour.

This option is ignored by importFiles.

[showProgress] boolean false

Similar to showScannerUI, when this option is true, the scanner is asked to display a small progress dialog during scanning. These dialogs typically include a Cancel button.

When set to false, the scanner is asked not to display a progress dialog during scanning.

This option is ignored by importFiles.

[suppressBackgroundColor] boolean false

If and only if VRS processing is enabled and resultPixelType is PixelType.Auto, setting suppressBackgroundColor true causes solid-color background to be considered white, so if there is no other color content on a scanned image, the image will be recognized as and converted to 1-bit B&W.

This is useful when your scan batch or imported images may include invoices and other documents printed on colored paper - which you want converted to B&W - but you also expect some pages with color content which you want preserved.

[tiff] object

Tiff images compression settings.

Properties
Name Type Default Description
[jpegCompression] boolean false

indicates whether to use jpeg compression for Tiff images.