Dynamic Web TWAIN: How to rotate the scanned image data prior to transfer?

With capability negotiation, you can use the capability ICAP_ROTATION to rotate the scanned image data before it's transferred.

Note: Before using these methods, please make sure that the driver of your device supports automatic rotating.

Code Snippet

function btnScan() 
{
    DWObject.SelectSource();
    DWObject.OpenSource();
    DWObject.MaxImagesInBuffer = 4; 
        
   /*============== rotate ==============*/
    DWObject.Capability = EnumDWT_Cap.ICAP_ROTATION; 
    DWObject.CapType  =  EnumDWT_CapType.TWON_ONEVALUE; 
    DWObject.CapValue = 270; //270 degree rotation
  		if (DWObject.CapSet())
		    alert("Successful");
		else
		    alert("Source doesn't support this capability");	
    DWObject.IfDisableSourceAfterAcquire = true;   
    DWObject.AcquireImage();
}

Reference:

Capabilities

For more information, please refer to How to Perform Capability Negotiation.