Dev Center
Table of contents

Thanks for Downloading Dynamic Web TWAIN 30-Day Trial!

Your download will start shortly. If your download does not begin, click here to retry.

Image Editing

How can I resize all images to meet a certain size standard (e.g. A4 size)?

Simply, you can use PageSize to set the page size to be used when acquiring images. Or you can leverage the negotiation capabilities functionality by following the steps mentioned below.

  1. ask for the supported sizes of your device.
DWObject.getCapabilities(
  function (result) {
    for (var i = 0; i < result.length; i++) {
      if (
        result[i].capability.value ===
        Dynamsoft.DWT.EnumDWT_Cap.ICAP_SUPPORTEDSIZES
      )
        sizes = result[i].values;
    }
    console.log(sizes);
  },
  function (error) {
    console.log(error);
  }
);
  1. set the page size to a size standard as needed.
DWObject.setCapabilities(
  {
    exception: "ignore",
    capabilities: [
      {
        capability: Dynamsoft.DWT.EnumDWT_Cap.ICAP_SUPPORTEDSIZES,
        curValue: 1, // 1 means 'A4' in our case
        exception: "fail",
      },
    ],
  },
  function (result) {
    console.log(result);
  },
  function (error) {
    console.log(error);
  }
);

A list of the values of various supported sizes can be found here. You can use the value for the curValue property.

Is this page helpful?

YesYes NoNo

In this article:

latest version

    • Latest Version (18.4)
    • Version 18.3
    • Version 18.1
    • Version 18.0
    • Version 17.3
    • Version 17.2.1
    • Version 17.1.1
    • Version 17.0
    • Version 16.2
    • Version 16.1.1
    Change +