Dev Center
Table of contents

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
    • 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