Dynamic Web TWAIN: How to get the size of the scanned images

You can use the method GetSelectedImagesSize to get the size of the selected images.

Code Snippet

//get the size of all images in buffer
size = 0;
function btnScan_onclick()
{
   DWObject.SelectSource();
   DWObject.OpenSource();
   DWObject.AcquireImage();
}
function OnPostAllTransfers()
{ 
  var count = DWObject.HowManyImagesInBuffer;
  DWObject.SelectedImagesCount = count
  for (var i = 0; i < count; i++) {
    DWObject.SetSelectedImageIndex(i, i);
  }
  size = DWObject.GetSelectedImagesSize(EnumDWT_ImageType.IT_PDF);// calculate the total size of selected images in PDF format
  alert(size);
}