【发布时间】:2015-06-24 22:38:47
【问题描述】:
如何从扫描仪获取图像输出作为 HTML 文件输入字段的文件输入。我正在使用 dynasoft web twain api 来扫描图像。http://www.dynamsoft.com/Support/DWTGuide/Dynamic%20Web%20TWAIN%20SDK.html#Manual
获取扫描图像的片段 -
var DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
DWObject.IfDisableSourceAfterAcquire = true; // Source will be closed automatically after acquisition.
DWObject.SelectSource(); // Select a Data Source (a device like scanner) from the Data Source Manager.
DWObject.OpenSource(); // Open the source. You can set resolution, pixel type, etc. after this method. Please refer to the sample 'Scan' -> 'Custom Scan' for more info.
DWObject.AcquireImage();
文件输入片段 -
<input type="file" id="fileselect" accept="image/*,application/pdf" capture="camera" app-file-select="onFileSelect($files)" app-change="getFile($files)" app-model="file" style="display:none">
Html 文件正在服务器端作为 MultipartFile 处理。
提前致谢
【问题讨论】: