Skip to content

Commit 0c06268

Browse files
committed
update to fit new packages
1 parent ffda62a commit 0c06268

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+791
-619
lines changed

hello-world/angular/README.md

Lines changed: 44 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -23,28 +23,50 @@ ng new my-app
2323

2424
```cmd
2525
cd my-app
26-
npm install dynamsoft-utility
27-
npm install dynamsoft-capture-vision-router
28-
npm install dynamsoft-camera-enhancer
26+
npm install @dynamsoft/dynamsoft-core
27+
npm install @dynamsoft/dynamsoft-license
28+
npm install @dynamsoft/dynamsoft-utility
29+
npm install @dynamsoft/dynamsoft-barcode-reader
30+
npm install @dynamsoft/dynamsoft-capture-vision-router
31+
npm install @dynamsoft/dynamsoft-camera-enhancer
2932
```
3033

3134
## Start to implement
3235

33-
### Add files "dbr.ts", "cvr.ts" and "dce.ts" under "/src/" to configure libraries
36+
### Add file "cvr.ts" under "/src/" to configure libraries
3437

3538
```typescript
36-
// dbr.ts
37-
import { BarcodeReaderModule } from "dynamsoft-barcode-reader";
38-
BarcodeReaderModule.engineResourcePath = "https://cdn.jsdelivr.net/npm/[email protected]/dist/";
39-
```
39+
import { CoreModule } from '@dynamsoft/dynamsoft-core';
40+
import { LicenseManager } from '@dynamsoft/dynamsoft-license';
41+
import '@dynamsoft/dynamsoft-barcode-reader';
42+
43+
/** LICENSE ALERT - README
44+
* To use the library, you need to first specify a license key using the API "initLicense()" as shown below.
45+
*/
46+
47+
LicenseManager.initLicense(
48+
'DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9'
49+
);
50+
51+
/**
52+
* You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dbr&package=js to get your own trial license good for 30 days.
53+
* Note that if you downloaded this sample from Dynamsoft while logged in, the above license key may already be your own 30-day trial license.
54+
* For more information, see https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/?ver=9.6.20&utm_source=github#specify-the-license or contact [email protected].
55+
* LICENSE ALERT - THE END
56+
*/
57+
58+
CoreModule.engineResourcePaths = {
59+
std: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
60+
dip: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
61+
core: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
62+
license: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
63+
cvr: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
64+
dbr: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
65+
dce: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/"
66+
};
4067

41-
```typescript
42-
// cvr.ts
43-
import { CaptureVisionRouter, LicenseManager } from 'dynamsoft-capture-vision-router';
44-
CaptureVisionRouter.engineResourcePath = 'https://cdn.jsdelivr.net/npm/[email protected]/dist/';
45-
LicenseManager.initLicense('DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9');
4668
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
47-
CaptureVisionRouter.preloadModule(['DBR']).catch((ex) => {
69+
CoreModule.loadWasm(['DBR']).catch((ex) => {
4870
let errMsg;
4971
if (ex.message?.includes('network connection error')) {
5072
errMsg =
@@ -57,16 +79,10 @@ CaptureVisionRouter.preloadModule(['DBR']).catch((ex) => {
5779
});
5880
```
5981

60-
```typescript
61-
// dce.ts
62-
import { CameraView } from "dynamsoft-camera-enhancer";
63-
CameraView.engineResourcePath = "https://cdn.jsdelivr.net/npm/[email protected]/dist/";
64-
```
65-
6682
> Note:
6783
>
6884
> * `initLicense()` specify a license key to use the library. You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=sample&product=dbr&package=js to get your own trial license good for 30 days.
69-
> * `engineResourcePath` tells the library where to get the necessary resources at runtime.
85+
> * `engineResourcePaths` tells the library where to get the necessary resources at runtime.
7086
7187
### Generate three components
7288
* `video-capture` component helps read barcode from camera.
@@ -103,17 +119,17 @@ ng generate component hello-world
103119

104120
```typescript
105121
import { Component, ElementRef, ViewChild } from '@angular/core';
106-
import { EnumCapturedResultItemType } from 'dynamsoft-core'
107-
import { DecodedBarcodesResult } from 'dynamsoft-barcode-reader';
122+
import { EnumCapturedResultItemType } from '@dynamsoft/dynamsoft-core'
123+
import { DecodedBarcodesResult } from '@dynamsoft/dynamsoft-barcode-reader';
108124
import {
109125
CameraEnhancer,
110126
CameraView,
111-
} from 'dynamsoft-camera-enhancer';
127+
} from '@dynamsoft/dynamsoft-camera-enhancer';
112128
import {
113129
CapturedResultReceiver,
114130
CaptureVisionRouter,
115-
} from 'dynamsoft-capture-vision-router';
116-
import { MultiFrameResultCrossFilter } from 'dynamsoft-utility';
131+
} from '@dynamsoft/dynamsoft-capture-vision-router';
132+
import { MultiFrameResultCrossFilter } from '@dynamsoft/dynamsoft-utility';
117133

118134
@Component({
119135
selector: 'app-video-capture',
@@ -235,8 +251,8 @@ export class VideoCaptureComponent {
235251

236252
```typescript
237253
import { Component } from '@angular/core';
238-
import { BarcodeResultItem } from 'dynamsoft-barcode-reader';
239-
import { CaptureVisionRouter } from 'dynamsoft-capture-vision-router';
254+
import { BarcodeResultItem } from '@dynamsoft/dynamsoft-barcode-reader';
255+
import { CaptureVisionRouter } from '@dynamsoft/dynamsoft-capture-vision-router';
240256

241257
@Component({
242258
selector: 'app-image-capture',
@@ -344,9 +360,7 @@ h1 {
344360

345361
```typescript
346362
import { Component } from '@angular/core';
347-
import '../../dbr'; // import side effects. The license, engineResourcePath, so on.
348363
import '../../cvr'; // import side effects. The license, engineResourcePath, so on.
349-
import '../../dce'; // import side effects. The license, engineResourcePath, so on.
350364

351365
@Component({
352366
selector: 'app-hello-world',

hello-world/angular/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@
1818
"@angular/platform-browser": "^16.2.0",
1919
"@angular/platform-browser-dynamic": "^16.2.0",
2020
"@angular/router": "^16.2.0",
21-
"dynamsoft-camera-enhancer": "^4.0.1",
22-
"dynamsoft-capture-vision-router": "^2.0.20",
23-
"dynamsoft-utility": "^1.0.10",
21+
"@dynamsoft/dynamsoft-barcode-reader": "^10.0.20-dev-20231222153407",
22+
"@dynamsoft/dynamsoft-camera-enhancer": "^4.0.1-dev-20231222174818",
23+
"@dynamsoft/dynamsoft-capture-vision-router": "^2.0.20-dev-20231222144235",
24+
"@dynamsoft/dynamsoft-core": "^3.0.20-dev-20231222181259",
25+
"@dynamsoft/dynamsoft-license": "^3.0.0-dev-20231222153411",
26+
"@dynamsoft/dynamsoft-utility": "^1.0.10-dev-20231220174819",
2427
"rxjs": "~7.8.0",
2528
"tslib": "^2.3.0",
2629
"zone.js": "~0.13.0"

hello-world/angular/src/app/hello-world/hello-world.component.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
import { Component } from '@angular/core';
2-
import '../../dbr'; // import side effects. The license, engineResourcePath, so on.
32
import '../../cvr'; // import side effects. The license, engineResourcePath, so on.
4-
import '../../dce'; // import side effects. The license, engineResourcePath, so on.
53

64
@Component({
75
selector: 'app-hello-world',

hello-world/angular/src/app/image-capture/image-capture.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Component } from '@angular/core';
2-
import { BarcodeResultItem } from 'dynamsoft-barcode-reader';
3-
import { CaptureVisionRouter } from 'dynamsoft-capture-vision-router';
2+
import { BarcodeResultItem } from '@dynamsoft/dynamsoft-barcode-reader';
3+
import { CaptureVisionRouter } from '@dynamsoft/dynamsoft-capture-vision-router';
44

55
@Component({
66
selector: 'app-image-capture',

hello-world/angular/src/app/video-capture/video-capture.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import { Component, ElementRef, ViewChild } from '@angular/core';
2-
import { EnumCapturedResultItemType } from 'dynamsoft-core'
3-
import { DecodedBarcodesResult } from 'dynamsoft-barcode-reader';
2+
import { EnumCapturedResultItemType } from '@dynamsoft/dynamsoft-core'
3+
import { DecodedBarcodesResult } from '@dynamsoft/dynamsoft-barcode-reader';
44
import {
55
CameraEnhancer,
66
CameraView,
7-
} from 'dynamsoft-camera-enhancer';
7+
} from '@dynamsoft/dynamsoft-camera-enhancer';
88
import {
99
CapturedResultReceiver,
1010
CaptureVisionRouter,
11-
} from 'dynamsoft-capture-vision-router';
12-
import { MultiFrameResultCrossFilter } from 'dynamsoft-utility';
11+
} from '@dynamsoft/dynamsoft-capture-vision-router';
12+
import { MultiFrameResultCrossFilter } from '@dynamsoft/dynamsoft-utility';
1313

1414
@Component({
1515
selector: 'app-video-capture',

hello-world/angular/src/cvr.ts

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
import {
2-
CaptureVisionRouter,
3-
LicenseManager,
4-
} from 'dynamsoft-capture-vision-router';
5-
6-
CaptureVisionRouter.engineResourcePath =
7-
'https://cdn.jsdelivr.net/npm/[email protected]/dist/';
1+
import { CoreModule } from '@dynamsoft/dynamsoft-core';
2+
import { LicenseManager } from '@dynamsoft/dynamsoft-license';
3+
import '@dynamsoft/dynamsoft-barcode-reader';
84

95
/** LICENSE ALERT - README
106
* To use the library, you need to first specify a license key using the API "initLicense()" as shown below.
@@ -21,8 +17,18 @@ LicenseManager.initLicense(
2117
* LICENSE ALERT - THE END
2218
*/
2319

20+
CoreModule.engineResourcePaths = {
21+
std: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
22+
dip: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
23+
core: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
24+
license: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
25+
cvr: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
26+
dbr: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/",
27+
dce: "https://npm.scannerproxy.com/cdn/@dynamsoft/[email protected]/dist/"
28+
};
29+
2430
// Preload "BarcodeReader" module for reading barcodes. It will save time on the initial decoding by skipping the module loading.
25-
CaptureVisionRouter.preloadModule(['DBR']).catch((ex) => {
31+
CoreModule.loadWasm(['DBR']).catch((ex) => {
2632
let errMsg;
2733
if (ex.message?.includes('network connection error')) {
2834
errMsg =

hello-world/angular/src/dbr.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

hello-world/angular/src/dce.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

hello-world/electron/README.md

Lines changed: 23 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,14 @@ npm init
2323

2424
```cmd
2525
npm install electron --save-dev
26-
npm install dynamsoft-utility
27-
npm install dynamsoft-capture-vision-router
28-
npm install dynamsoft-camera-enhancer
26+
npm install @dynamsoft/dynamsoft-capture-vision-std
27+
npm install @dynamsoft/dynamsoft-image-processing
28+
npm install @dynamsoft/dynamsoft-core
29+
npm install @dynamsoft/dynamsoft-license
30+
npm install @dynamsoft/dynamsoft-utility
31+
npm install @dynamsoft/dynamsoft-barcode-reader
32+
npm install @dynamsoft/dynamsoft-capture-vision-router
33+
npm install @dynamsoft/dynamsoft-camera-enhancer
2934
```
3035

3136
## Start to implement
@@ -86,11 +91,12 @@ Create the page to be loaded in the created window.
8691
<meta name="keywords" content="barcode, camera, Electron">
8792
<title>Dynamsoft Barcode Reader Sample - Electron</title>
8893
<link href="style.css" rel="stylesheet">
89-
<script src="./node_modules/dynamsoft-core/dist/core.js"></script>
90-
<script src="./node_modules/dynamsoft-utility/dist/utility.js"></script>
91-
<script src="./node_modules/dynamsoft-barcode-reader/dist/dbr.js"></script>
92-
<script src="./node_modules/dynamsoft-capture-vision-router/dist/cvr.js"></script>
93-
<script src="./node_modules/dynamsoft-camera-enhancer/dist/dce.js"></script>
94+
<script src="./node_modules/@dynamsoft/dynamsoft-core/dist/core.js"></script>
95+
<script src="./node_modules/@dynamsoft/dynamsoft-license/dist/license.js"></script>
96+
<script src="./node_modules/@dynamsoft/dynamsoft-utility/dist/utility.js"></script>
97+
<script src="./node_modules/@dynamsoft/dynamsoft-barcode-reader/dist/dbr.js"></script>
98+
<script src="./node_modules/@dynamsoft/dynamsoft-capture-vision-router/dist/cvr.js"></script>
99+
<script src="./node_modules/@dynamsoft/dynamsoft-camera-enhancer/dist/dce.js"></script>
94100
</head>
95101
<body>
96102
<h1>Hello World for Electron</h1>
@@ -120,12 +126,15 @@ Dynamsoft.License.LicenseManager.initLicense(
120126
* LICENSE ALERT - THE END
121127
*/
122128

123-
Dynamsoft.DCE.CameraView.engineResourcePath =
124-
"./node_modules/dynamsoft-camera-enhancer/dist/";
125-
Dynamsoft.DBR.BarcodeReaderModule.engineResourcePath =
126-
"./node_modules/dynamsoft-barcode-reader/dist/";
127-
Dynamsoft.CVR.CaptureVisionRouter.engineResourcePath =
128-
"./node_modules/dynamsoft-capture-vision-router/dist/";
129+
Dynamsoft.Core.CoreModule.engineResourcePaths = {
130+
std: "./node_modules/@dynamsoft/dynamsoft-capture-vision-std/dist/",
131+
dip: "./node_modules/@dynamsoft/dynamsoft-image-processing/dist/",
132+
core: "./node_modules/@dynamsoft/dynamsoft-core/dist/",
133+
license: "./node_modules/@dynamsoft/dynamsoft-license/dist/",
134+
cvr: "./node_modules/@dynamsoft/dynamsoft-capture-vision-router/dist/",
135+
dbr: "./node_modules/@dynamsoft/dynamsoft-barcode-reader/dist/",
136+
dce: "./node_modules/@dynamsoft/dynamsoft-camera-enhancer/dist/"
137+
};
129138
(async function () {
130139
try {
131140
// Create a `CameraEnhancer` instance for camera control and a `CameraView` instance for UI control.

hello-world/electron/action.js

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ Dynamsoft.License.LicenseManager.initLicense(
1313
* LICENSE ALERT - THE END
1414
*/
1515

16-
Dynamsoft.DCE.CameraView.engineResourcePath =
17-
"./node_modules/dynamsoft-camera-enhancer/dist/";
18-
Dynamsoft.DBR.BarcodeReaderModule.engineResourcePath =
19-
"./node_modules/dynamsoft-barcode-reader/dist/";
20-
Dynamsoft.CVR.CaptureVisionRouter.engineResourcePath =
21-
"./node_modules/dynamsoft-capture-vision-router/dist/";
16+
Dynamsoft.Core.CoreModule.engineResourcePaths = {
17+
std: "./node_modules/@dynamsoft/dynamsoft-capture-vision-std/dist/",
18+
dip: "./node_modules/@dynamsoft/dynamsoft-image-processing/dist/",
19+
core: "./node_modules/@dynamsoft/dynamsoft-core/dist/",
20+
license: "./node_modules/@dynamsoft/dynamsoft-license/dist/",
21+
cvr: "./node_modules/@dynamsoft/dynamsoft-capture-vision-router/dist/",
22+
dbr: "./node_modules/@dynamsoft/dynamsoft-barcode-reader/dist/",
23+
dce: "./node_modules/@dynamsoft/dynamsoft-camera-enhancer/dist/"
24+
};
2225
(async function () {
2326
try {
2427
// Create a `CameraEnhancer` instance for camera control and a `CameraView` instance for UI control.

0 commit comments

Comments
 (0)