我收到来自动态 Web twain 的“convertToBlob”方法的索引超出范围错误,我使用它通过扫描仪扫描文档,有人可以帮忙吗?
dwObject.ConvertToBlob([0], EnumDWT_ImageType.IT_JPG, (result) => {
const data = new File([result], 'Scan.jpeg', result);
let attachmentsBlob = [];
let attachmentObject = [];
directAccess ? attachmentObject.push({ attachmentName: "Scan.jpeg", attachmentType: parentType, documentType: type }) : attachmentObject.push({ attachmentName: "Scan.jpeg", attachmentType: type });
attachmentsBlob.push(data);
this.customerAttachment(attachmentObject, attachmentsBlob).subscribe((res: any) => {
if (res['code'] === '0000') {
this.toastr.success("Attachement uploaded Successfully");
if (directAccess) {
form.patchValue(res.data[0]);
} else {
let scan = form.controls.customerAttachments.value;
scan.push(res.data[0]);
form.controls.customerAttachments.setValue(scan);
}
} else if (res['code'] === '0101') {
this.toastr.error('Error', res['data']['message']);
}
});
}, (errorCode, errorString) => {
this.toastr.error(errorString);
});