{DeviceObject} Scan
The properties and methods on this page live in the namespace {DeviceObject}.
interface Device {
/**
* The real name of the device.
*/
readonly name: string;
/**
* The displayed name of the device.
*/
readonly displayName: string;
readonly deviceType: Dynamsoft.EnumDWT_DeviceType;
readonly serviceInfo?: ServiceInfo;
readonly deviceInfo?: any;
acquireImage(deviceConfiguration: DeviceConfiguration | null, sendTo: WebTwain): Promise< boolean>;
}
Methods
DeviceObject.acquireImage() |
DeviceObject.acquireImage()
Syntax
/**
* Scan documents into another DWObject control. Supports eSCL scanners and all other scanners with limited capabilities.
* @param deviceConfiguration The device configuration
* @param sendTo The DWObject control to scan into
*/
acquireImage(deviceConfiguration: DeviceConfiguration | null, sendTo: WebTwain): Promise< boolean>;
interface DeviceConfiguration {
IfShowUI?: boolean; //Whether to show the built-in User Interface from the device vendor
PixelType?: Dynamsoft.DWT.EnumDWT_PixelType | number | string; //Whether to scan in color, grey or black & white
Resolution?: number; //Measured by dots per pixel (DPI)
IfFeederEnabled?: boolean; //Whether to use the document feeder or the flatbed of the device
IfDuplexEnabled?: boolean; //Whether to scan one side or both sides
IfDisableSourceAfterAcquire?: boolean; //Whether to close the built-in User Interface after aquisition. Only valid when {IfShowUI} is true.
IfGetImageInfo?: boolean; //Whether to retrieve information about the image after it's transferred.
IfGetExtImageInfo?: boolean; //Whether to retrieve extended information about the image after it's transferred.
extendedImageInfoQueryLevel?: Dynamsoft.DWT.EnumDWT_ExtImageInfo | number; //How much extended information is retrieved. Only valid when {IfGetExtImageInfo} is true.
SelectSourceByIndex?: number; //Specify a source by its index.
IfCloseSourceAfterAcquire?: boolean; //Whether to close the data source after aquisition. Default: false.
}
Example
DWObject.GetDevicesAsync().then((deviceList)=>{
return deviceList[0].acquireImage({},DWObject)
}).then((result)=>{
console.log(result)
}).catch((e)=>{
console.error(e)
})
Availability
ActiveX | H5(Windows) | H5(macOS/TWAIN) | H5(macOS/ICA) | H5(Linux) |
not supported | v18.0+ | v18.0+ | v18.0+ | v18.0+ |