Skip to content

Commit e72baea

Browse files
update to internal commit 387ca76a
1 parent 1077d49 commit e72baea

File tree

13 files changed

+574
-11
lines changed

13 files changed

+574
-11
lines changed

_data/product_version.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
useGroupedVersion: true
22

33
version_info_list:
4-
- value: latest version(2.4.2000)
4+
- value: latest version(2.4.2001)
55
- value: 2.x
66
child:
7+
- 2.4.2000
78
- 2.2.3000

assets/js/dcvWebVersionSearch.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
[
2+
{
3+
"version": "2.4.2001",
4+
"matchVersion": {
5+
"javascript": "10.4.2001"
6+
}
7+
},
28
{
39
"version": "2.4.2000",
410
"matchVersion": {

programming/javascript/api-reference/capture-vision-router/multiple-image-processing-v2.0.10.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ startCapturing(templateName?: string): Promise<void>;
327327

328328
**Parameters**
329329

330-
`templateName`: specifies a "CaptureVisionTemplate" to use. If not specified, "Default" is used. There are two types of CaptureVisionTemplates: the [preset ones](./preset-templates.md) which come with the SDK and the custom ones that get initialized when the user calls [initSettings](./settings.md#initsettings). Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten should the user calls [initSettings](./settings.md#initsettings) and pass his own settings.
330+
`templateName`: specifies a "CaptureVisionTemplate" to use. If not specified, "Default" is used. There are two types of CaptureVisionTemplates: the [preset ones](./preset-templates.md) which come with the SDK and the custom ones that get initialized when the user calls [initSettings](./settings.md#initsettings). Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten if the user calls [initSettings](./settings.md#initsettings) and passes customized settings.
331331

332332
**Return Value**
333333

programming/javascript/api-reference/capture-vision-router/multiple-image-processing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ startCapturing(templateName?: string): Promise<void>;
342342

343343
There are two types of CaptureVisionTemplates: the [preset ones](./preset-templates.md) which come with the SDK and the custom ones that get initialized when the user calls [initSettings](./settings.md#initsettings).
344344

345-
Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten should the user calls [initSettings](./settings.md#initsettings) and pass his own settings.
345+
Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten if the user calls [initSettings](./settings.md#initsettings) and passes customized settings.
346346

347347
**Return Value**
348348

programming/javascript/api-reference/capture-vision-router/single-image-processing-v2.0.10.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ capture(imageOrFile: Core.DSImageData | string | Blob | HTMLImageElement | HTMLC
2929

3030
`imageOrFile`: specifies the image or file to be processed. It can be the image itself in the form of `DSImageData`, the path of the image/file or the file itself in the form of `blob`, `HTMLImageElement` or `HTMLCanvasElement`.
3131

32-
`templateName`: specifies a "CaptureVisionTemplate" to use. If not specified, "Default" is used. There are two types of CaptureVisionTemplates: the [preset ones](./preset-templates.md) which come with the SDK and the custom ones that get initialized when the user calls [initSettings](./settings.md#initsettings). Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten should the user calls [initSettings](./settings.md#initsettings) and pass his own settings.
32+
`templateName`: specifies a "CaptureVisionTemplate" to use. If not specified, "Default" is used. There are two types of CaptureVisionTemplates: the [preset ones](./preset-templates.md) which come with the SDK and the custom ones that get initialized when the user calls [initSettings](./settings.md#initsettings). Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten if the user calls [initSettings](./settings.md#initsettings) and passes customized settings.
3333

3434
**Return value**
3535

programming/javascript/api-reference/capture-vision-router/single-image-processing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ capture(imageOrFile: Blob | HTMLImageElement | HTMLCanvasElement | HTMLVideoElem
3333

3434
There are two types of CaptureVisionTemplates: the [preset ones](./preset-templates.md) which come with the SDK and the custom ones that get initialized when the user calls [initSettings](./settings.md#initsettings).
3535

36-
Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten should the user calls [initSettings](./settings.md#initsettings) and pass his own settings.
36+
Please be aware that the [preset CaptureVisionTemplates](./preset-templates.md) will be overwritten if the user calls [initSettings](./settings.md#initsettings) and passes customized settings.
3737

3838
**Return value**
3939

Lines changed: 241 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,241 @@
1+
---
2+
layout: default-layout
3+
title: API Reference Index - CoreModule Class in JavaScript
4+
description: This page introduces the API for the CoreModule Class.
5+
keywords: Core, CoreModule, api reference, javascript, js
6+
needAutoGenerateSidebar: true
7+
needGenerateH3Content: true
8+
noTitleIndex: true
9+
---
10+
<!--v3.0.20--Updated on 11/23/2023-->
11+
12+
# CoreModule Class
13+
14+
The CoreModule class defines common functionality in the Core module.
15+
16+
| Name | Description |
17+
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
18+
| `static` [detectEnvironment()](#detectenvironment) | Detects and returns information about the current runtime environment. |
19+
| `static` [engineResourcePaths](#engineresourcepaths) | Configures the paths where the .wasm files and other necessary resources for modules are located. |
20+
| `static` [getVersion()](#getversion) | Returns the version of the Core module. |
21+
| `static` [isModuleLoaded()](#ismoduleloaded) | Returns whether the WebAssembly (.wasm) file for the specified module is successfully loaded. |
22+
| `static` [loadWasm()](#loadwasm) | Initiates the loading process for the .wasm file(s) corresponding to the specified module(s). |
23+
24+
<!--
25+
| `static` [onLog](#onlog) | Event triggered whenever a log message is ready to be dispatched. |
26+
| `static` [disableLogging()](#disablelogging) | Disables logging. |
27+
| `static` [enableLogging()](#enablelogging) | Enables logging to print internal logs to the browser console for debugging. | -->
28+
29+
## detectEnvironment
30+
31+
Detects and returns information about the current runtime environment.
32+
33+
```typescript
34+
detectEnvironment(): Promise<any>
35+
```
36+
37+
**Return Value**
38+
39+
A promise that resolves with the detected environment information (e.g., browser type and version, operating system, camera support, etc.).
40+
41+
**Code snippet**
42+
43+
```javascript
44+
await Dynamsoft.Core.CoreModule.detectEnvironment();
45+
// Example return value:
46+
// {"wasm":true,"worker":true,"getUserMedia":true,"camera":true,"browser":"Edge","version":119,"OS":"Windows"}
47+
```
48+
49+
## engineResourcePaths
50+
51+
Configures the paths where the .wasm files and other necessary resources for modules are located. It allows you to either return or set the paths that the system uses to find these resources.
52+
53+
For resources loaded from popular CDNs like jsDelivr or UNPKG, the paths are automatically identified based on the JavaScript files referenced for these modules. Manual specification of these paths is necessary only in the following scenarios:
54+
55+
1. When integrating the SDK within web frameworks such as Angular, React, or Vue.
56+
2. If you opt for a CDN different from the default choices.
57+
3. When you are serving the files on your own.
58+
59+
<!--
60+
> Specifying only the "rootDirectory" configures all paths to align with this directory automatically. However, if you provide both "rootDirectory" and specific paths for individual modules, the specific module paths will override the root directory setting.
61+
/** NOT WORKING AS EXPECTED YET
62+
* Specifies the root directory in which all the modules are located
63+
*/
64+
"rootDirectory"?: string;
65+
/** WILL BE RENAMED TO dlrData LATER
66+
* Specifies the resource path for the dynamsoft-capture-vision-dnn module.
67+
*/
68+
"dcm"?: string;
69+
/** NOT AVAILABLE NOW
70+
* Specifies the resource path for the dynamsoft-capture-vision-dnn module.
71+
*/
72+
"dnn"?: string;
73+
-->
74+
```typescript
75+
static engineResourcePaths: {
76+
/**
77+
* Specifies the resource path for the dynamsoft-capture-vision-std module.
78+
*/
79+
"std"?: string;
80+
/**
81+
* Specifies the resource path for the dynamsoft-image-processing module.
82+
*/
83+
"dip"?: string;
84+
/**
85+
* Specifies the resource path for the dynamsoft-core module.
86+
*/
87+
"core"?: string;
88+
/**
89+
* Specifies the resource path for the dynamsoft-license module.
90+
*/
91+
"license"?: string;
92+
/**
93+
* Specifies the resource path for the dynamsoft-capture-vision-router module.
94+
*/
95+
"cvr"?: string;
96+
/**
97+
* Specifies the resource path for the dynamsoft-utility module.
98+
*/
99+
"utility"?: string;
100+
/**
101+
* Specifies the resource path for the dynamsoft-barcode-reader module.
102+
*/
103+
"dbr"?: string;
104+
/**
105+
* Specifies the resource path for the dynamsoft-label-recognizer module.
106+
*/
107+
"dlr"?: string;
108+
/**
109+
* Specifies the resource path for the dynamsoft-document-normalizer module.
110+
*/
111+
"ddn"?: string;
112+
/**
113+
* Specifies the resource path for the dynamsoft-code-parser module.
114+
*/
115+
"dcp"?: string;
116+
/**
117+
* Specifies the resource path for the dynamsoft-camera-enhancer module.
118+
*/
119+
"dce"?: string;
120+
};
121+
```
122+
123+
**Code snippet**
124+
125+
```javascript
126+
// To specify the paths for multiple modules:
127+
Dynamsoft.Core.CoreModule.engineResourcePaths = {
128+
"std": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
129+
"dip": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
130+
"core": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
131+
"license": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
132+
"cvr": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
133+
"utility": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
134+
"dbr": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/"
135+
"dlr": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",
136+
"ddn": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/"
137+
"dcp": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/"
138+
};
139+
// To specify the path for only one module:
140+
Dynamsoft.Core.CoreModule.engineResourcePaths.dbr = "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/";
141+
```
142+
143+
## getVersion
144+
145+
Returns the version of the Core module.
146+
147+
```typescript
148+
static getVersion(): string;
149+
```
150+
151+
**Return Value**
152+
153+
A string type representing the version.
154+
155+
**Code snippet**
156+
157+
```javascript
158+
const version = Dynamsoft.Core.CoreModule.getVersion();
159+
console.log(version);
160+
```
161+
162+
## isModuleLoaded
163+
164+
Returns whether the WebAssembly (.wasm) file for the specified module is successfully loaded.
165+
166+
```typescript
167+
static isModuleLoaded(moduleName: string): boolean;
168+
```
169+
170+
**Parameters**
171+
172+
`moduleName`: specifies a module.
173+
174+
**Return Value**
175+
176+
Boolean indicating whether the .wasm file for the specified module is loaded.
177+
178+
**Code snippet**
179+
180+
```javascript
181+
if(Dynamsoft.Core.CoreModule.isModuleLoaded("cvr")){
182+
console.log("cvr module is loaded!").
183+
}
184+
```
185+
186+
## loadWasm
187+
188+
Initiates the loading process for the .wasm file(s) corresponding to the specified module(s). If a module relies on other modules, the other modules will be loaded as well.
189+
190+
```typescript
191+
static loadWasm(moduleNames: Array<string> | string): Promise<void>;
192+
```
193+
194+
**Parameters**
195+
196+
`moduleNames`: specifies one or multiple modules. Supported module names are "cvr", "core", "license", "std", "dip", "dbr", "dlr", "ddn".
197+
198+
**Return Value**
199+
200+
A promise that resolves when the resources have been successfully released. It does not provide any value upon resolution.
201+
202+
**Code snippet**
203+
204+
```javascript
205+
await Dynamsoft.Core.CoreModule.loadWasm("cvr");
206+
```
207+
208+
<!--
209+
## onLog
210+
211+
Event triggered whenever a log message is ready to be dispatched.
212+
213+
```typescript
214+
static onLog: (message:string) =>void;
215+
```
216+
217+
**Parameters**
218+
219+
`message`: the log message ready to be dispatched.
220+
221+
**Code snippet**
222+
223+
```javascript
224+
Dynamsoft.Core.CoreModule.onLog = console.log;
225+
```
226+
227+
## disableLogging
228+
229+
Disables logging.
230+
231+
```typescript
232+
static disableLogging(): void;
233+
```
234+
235+
## enableLogging
236+
237+
Enables logging to print internal logs to the browser console for debugging.
238+
239+
```typescript
240+
static enableLogging(): void;
241+
``` -->

programming/javascript/api-reference/core/core-module-class.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ For resources loaded from popular CDNs like jsDelivr or UNPKG, the paths are aut
7373
-->
7474
```typescript
7575
static engineResourcePaths: {
76+
/**
77+
* Specifies the root directory in which all the modules are located
78+
*/
79+
"rootDirectory"?: string;
7680
/**
7781
* Specifies the resource path for the dynamsoft-capture-vision-std module.
7882
*/
@@ -123,6 +127,8 @@ static engineResourcePaths: {
123127
**Code snippet**
124128

125129
```javascript
130+
// To specify the path for rootDirectory
131+
Dynamsoft.Core.CoreModule.engineResourcePaths.rootDirectory = "https://cdn.jsdelivr.net/npm/";
126132
// To specify the paths for multiple modules:
127133
Dynamsoft.Core.CoreModule.engineResourcePaths = {
128134
"std": "https://[SPECIFY-THE-ROOT-DIRECTORY]/[email protected]/dist/",

programming/javascript/api-reference/license/license-manager.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,14 @@ A promise which, upon resolution, yields a string corresponding to the device's
3535
Initializes the license for the application using a license key. This function is overloaded, providing two different usages based on the provided parameters.
3636

3737
```typescript
38-
static initLicense(license: string, options?: {executeNow: boolean}): void | Promise<void>;
38+
static initLicense(license: string, options?: {executeNow: boolean} | boolean): void | Promise<void>;
3939
```
4040

4141
**Parameters**
4242

4343
`license`: The license key to be used for initialization.
4444

45-
`options`: This is an object with a single property executeNow, which is a boolean indicates the function should immediately execute the license initialization or not.
45+
`options`: It can be one of two types, a boolean or an object with a single property, executeNow, which is a boolean. If options is `true` or `{ executeNow: true }`, the license initialization action will be executed immediately.
4646

4747
**Return Value**
4848

programming/javascript/release-notes/dcvb.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,12 @@ noTitleIndex: true
99

1010
# Release Notes - DynamsoftCaptureVisionBundle
1111

12+
## 2.4.2001 (10/11/2024)
13+
14+
### Fixed
15+
16+
- Fixed the issue where the rootPath definition in `engineResourcePaths` failed to function correctly in certain scenarios.
17+
1218
## 2.4.2000 (10/10/2024)
1319

1420
### Highlights

0 commit comments

Comments
 (0)