Skip to content

Commit bb7f4be

Browse files
update to web-twain 18.3
1 parent 4f0243c commit bb7f4be

4 files changed

Lines changed: 42 additions & 46 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
This project demonstrates how to build an Angular scanning project with [Dynamsoft Web TWAIN SDK](https://www.dynamsoft.com/web-twain/overview/).
44

55
## Usage
6-
Environment: Node.js v16.20.0
6+
Environment: Node.js v18.16.0
77
1. Apply for a [30-day free trial license](https://www.dynamsoft.com/customer/license/trialLicense?product=dwt) of Dynamic Web TWAIN.
88

99
2. Update the license key in `src\app\dwt\dwt.component.ts` file:

package.json

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,37 +11,37 @@
1111
},
1212
"private": true,
1313
"dependencies": {
14-
"@angular/animations": "~12.0.0",
15-
"@angular/common": "~12.0.0",
16-
"@angular/compiler": "~12.0.0",
17-
"@angular/core": "~12.0.0",
18-
"@angular/forms": "~12.0.0",
19-
"@angular/platform-browser": "~12.0.0",
20-
"@angular/platform-browser-dynamic": "~12.0.0",
21-
"@angular/router": "~12.0.0",
22-
"dwt": "18.2.0",
23-
"rxjs": "~6.6.0",
24-
"tslib": "^2.1.0",
25-
"zone.js": "~0.11.4"
14+
"@angular/animations": "~16.0.0",
15+
"@angular/common": "~16.0.0",
16+
"@angular/compiler": "~16.0.0",
17+
"@angular/core": "~16.0.0",
18+
"@angular/forms": "~16.0.0",
19+
"@angular/platform-browser": "~16.0.0",
20+
"@angular/platform-browser-dynamic": "~16.0.0",
21+
"@angular/router": "~16.0.0",
22+
"dwt": "18.3.0",
23+
"rxjs": "~7.8.1",
24+
"tslib": "^2.5.2",
25+
"zone.js": "~0.13.0"
2626
},
2727
"devDependencies": {
28-
"@angular-devkit/build-angular": "~12.0.0",
29-
"@angular/cli": "~12.0.0",
30-
"@angular/compiler-cli": "~12.0.0",
31-
"@angular/language-service": "~12.0.0",
32-
"@types/node": "^12.11.1",
33-
"@types/jasmine": "~3.6.0",
34-
"codelyzer": "^5.1.2",
35-
"jasmine-core": "~3.7.0",
36-
"jasmine-spec-reporter": "~4.2.1",
37-
"karma": "~6.3.0",
38-
"karma-chrome-launcher": "~3.1.0",
39-
"karma-coverage-istanbul-reporter": "~2.1.0",
40-
"karma-jasmine": "~4.0.0",
41-
"karma-jasmine-html-reporter": "^1.5.0",
42-
"protractor": "~5.4.3",
43-
"ts-node": "~8.3.0",
44-
"tslint": "~6.1.0",
45-
"typescript": "~4.2.3"
28+
"@angular-devkit/build-angular": "~16.0.0",
29+
"@angular/cli": "~16.0.0",
30+
"@angular/compiler-cli": "~16.0.0",
31+
"@angular/language-service": "~16.0.0",
32+
"@types/node": "^20.2.5",
33+
"@types/jasmine": "~4.3.2",
34+
"codelyzer": "^6.0.2",
35+
"jasmine-core": "~4.0.0",
36+
"jasmine-spec-reporter": "~7.0.0",
37+
"karma": "~6.4.2",
38+
"karma-chrome-launcher": "~3.2.0",
39+
"karma-coverage-istanbul-reporter": "~3.0.3",
40+
"karma-jasmine": "~5.1.0",
41+
"karma-jasmine-html-reporter": "^2.0.0",
42+
"protractor": "~7.0.0",
43+
"ts-node": "~10.9.1",
44+
"tslint": "~6.1.3",
45+
"typescript": "~4.9.5"
4646
}
4747
}

src/app/dwt/dwt.component.ts

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,28 @@ export class DwtComponent implements OnInit {
1111
DWObject: WebTwain;
1212
selectSources: HTMLSelectElement;
1313
containerId = 'dwtcontrolContainer';
14-
bWASM = false;
1514
deviceList=[];
1615
constructor() { }
1716
ngOnInit(): void {
1817
Dynamsoft.DWT.Containers = [{ WebTwainId: 'dwtObject', ContainerId: this.containerId, Width: '300px', Height: '400px' }];
1918
Dynamsoft.DWT.RegisterEvent('OnWebTwainReady', () => { this.Dynamsoft_OnReady(); });
2019
Dynamsoft.DWT.ResourcesPath = '/assets/dwt-resources';
21-
Dynamsoft.DWT.ProductKey = 't0100CgEAAI/Kalkph+rANa7xvFeYzy2ZJaF0sV188r8K/knF/akFHHvAHdHAtGHQJrpxP+nqlDJkXOD65sKMbWhdmp6b7QgCWLr5A0huNQqu+DW0v3gAgcFwAvEGSBQj0nwHo981mg==';
20+
Dynamsoft.DWT.ProductKey = 't0106KwEAAHS5i/IQMtobY1KiE0ohnvp0rYQ6Odqe3YSTuwoeLvNCke4y7UccAqchMe1OUgSW/vPP42qfMZqjyorwWR/DnRUBbMP5AyjcPbyr+HVod/EEDJNDB2wFSOh/Xnlxg6lISUkO19Q75w==';
2221
Dynamsoft.DWT.Load();
2322
}
2423

2524
Dynamsoft_OnReady(): void {
2625
this.DWObject = Dynamsoft.DWT.GetWebTwain('dwtcontrolContainer');
27-
this.bWASM = Dynamsoft.Lib.env.bMobile || !Dynamsoft.DWT.UseLocalService;
2826
this.selectSources = <HTMLSelectElement>document.getElementById("sources");
29-
if(!Dynamsoft.Lib.env.bMobile){
30-
this.DWObject.GetDevicesAsync().then((devices)=>{
31-
this.selectSources.options.length = 0;
32-
for (var i = 0; i < devices.length; i++) { // Get how many sources are installed in the system
33-
this.selectSources.options.add(new Option(devices[i].displayName, i.toString())); // Add the sources in a drop-down list
34-
this.deviceList.push(devices[i]);
35-
}
36-
}).catch(function (exp) {
37-
alert(exp.message);
38-
});
39-
}
27+
this.DWObject.GetDevicesAsync().then((devices)=>{
28+
this.selectSources.options.length = 0;
29+
for (var i = 0; i < devices.length; i++) { // Get how many sources are installed in the system
30+
this.selectSources.options.add(new Option(devices[i].displayName, i.toString())); // Add the sources in a drop-down list
31+
this.deviceList.push(devices[i]);
32+
}
33+
}).catch(function (exp) {
34+
alert(exp.message);
35+
});
4036
}
4137

4238
acquireImage(): void {

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"module": "esnext",
1111
"moduleResolution": "node",
1212
"importHelpers": true,
13-
"target": "es2015",
13+
"target": "es2022",
1414
"lib": [
1515
"es2018",
1616
"dom"

0 commit comments

Comments
 (0)