Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Dev Center
Table of contents

Capture/Image Source

How can I get a list of supported resolution/DPI values from the document scanner?

You can use capability negotiation to get all the resolutions supported by the scanner.

Steps:

  • Step-1: Use getCapabilities to get all capabilities of the current data source,
DWObject.OpenSource();
DWObject.getCapabilities(
  function () {
    console.log(arguments);
  },
  function (error) {
    console.log(error);
  }
);

and then find the capability corresponding to the resolution. Normally, it is called ICAP_XRESOLUTION.

Capability Resolution

  • Step-2: Call the following code to get all the resolutions supported by the scanner.
DWObject.OpenSource();
DWObject.getCapabilities(
  function (result) {
    for (var i = 0; i < result.length; i++) {
      if (result[i].capability.value === Dynamsoft.DWT.EnumDWT_Cap.ICAP_XRESOLUTION) {
        if (result[i].conType.label === 'TWON_ENUMERATION') { // If the capability's Vaule Type is Enumeration
            dpi = result[i].values;
            console.log(dpi); // The list of supported resolution.
        } else if (result[i].conType.label === 'TWON_RANGE') { // If the capability's Vaule Type is Range
            max = result[i].maxValue;
            min = result[i].minValue;
            step = result[i].stepSize;

            console.log("maxValue: " + max); // The maximum value for the resolution.
            console.log("minValue: " + min); // The minimum value for the resolution.
            console.log("stepSize: " + step); // The step size for the resolution.
        } else {
            console.log("Please contact Dynamsoft for help.");
        }
      }
    }   
  },
  function (error) {
    console.log(error);
  }
);

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest Version
    • Version 17.2.1
    • Version 17.1.1
    • Version 17.0
    • Version 16.2
    • Version 16.1.1
    Change +
    © 2003–2022 Dynamsoft. All rights reserved.
    Privacy Statement / Site Map / Home / Purchase / Support