Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _data/product_version.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
useGroupedVersion: true

version_info_list_js:
- value: latest version
- value: latest version(2.2.10)
- value: 2.x
child:
- 2.0.20
Expand Down
53 changes: 53 additions & 0 deletions assets/js/dcpWebVersionSearch.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,57 @@
[
{
"version": "2.0.20",
"matchList": {
"js":{
"dcvRepoWeb": [
{
"path": "/programming/javascript/api-reference/utility",
"version": "1.2.10"
}, {
"path": "/programming/javascript/api-reference/license",
"version": "3.2.10"
}, {
"path": "/programming/javascript/api-reference/capture-vision-router",
"version": "2.2.10"
}, {
"path": "/programming/javascript/api-reference/core",
"version": "3.2.10"
}, {
"path": "/programming/javascript/api-reference/image-processing",
"version": "2.2.10"
}
],
"dcvRepoCore": [
{
"path": "/enums/capture-vision-router",
"version": "2.2.10"
}, {
"path": "/enums/core",
"version": "3.2.10"
},{
"path": "/parameters/reference/capture-vision-template",
"version": "2.2.10"
},{
"path": "/parameters/reference/target-roi-def",
"version": "2.2.10"
},{
"path": "/parameters/reference/document-normalizer-task-settings",
"version": "2.2.10"
},{
"path": "/parameters/reference/image-parameter",
"version": "2.2.10"
},{
"path": "/parameters/reference/image-source-options",
"version": "3.2.10"
},{
"path": "/parameters/reference/global-parameter",
"version": "2.2.10"
}
],
"dce": "4.0.2"
}
}
},
{
"version": "2.0.20",
"matchList": {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
layout: default-layout
title: CodeParserModule Class - Dynamsoft Code Parser JavaScript Edition API
description: This page introduces APIs related to the CodeParserModule Class of Dynamsoft Code Parser JavaScript Edition.
keywords: capture vision, code parser Module, api reference, javascript, js
needAutoGenerateSidebar: true
needGenerateH3Content: true
noTitleIndex: true
---

# CodeParserModule Class

The `CodeParserModule` class is defined in the namespace `Dynamsoft.DCP`.

| API Name | Description |
| ------------------------------------ | ----------------------------------------------------------- |
| `static` [getVersion()](#getversion) | Returns the version of the `CodeParser` module. |
| `static` [loadSpec()](#loadspec) | Loads the specification for a certain type of code strings. |

### getVersion

Returns the version of the `CodeParser` module.

```typescript
static getVersion(): string;
```

**Code snippet**

```javascript
const version = Dynamsoft.DCP.CodeParserModule.getVersion();
console.log(version);
```

### loadSpec

Loads the specification for a certain type of code strings.

```typescript
loadSpec(specificationName: string, specificationPath?: string): Promise<void>;
```

**Parameters**

* `specificationName`: specifies the name of the specification.
* `specificationPath`: specifies the path to find the specification file. If not specified, the method will try to load the file from the path specified for the "dcp" module in `Dynamsoft.Core.CoreModule.engineResourcePaths`. For example, if the path for the "dcp" module is "https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@2.0.20/dist/", then calling `Dynamsoft.DCP.CodeParserModule.loadSpec("AADHAAR")` will load the file "AADHAAR.data" from "https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@2.0.20/dist/specification/AADHAAR.data".

**Code Snippet**

```javascript
await Dynamsoft.DCP.CodeParserModule.loadSpec("AADHAAR");
```
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ console.log(version);
Loads the specification for a certain type of code strings.

```typescript
loadSpec(specificationName: string, specificationPath?: string): Promise<void>;
loadSpec(specificationName: string | Array<string>, specificationPath?: string): Promise<void>;
```

**Parameters**
Expand Down
2 changes: 1 addition & 1 deletion programming/javascript/api-reference/code-parser-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ The `CodeParser` class enable users to parse given bytes or a string.

## Interfaces

* [ParsedResultItem](./interfaces/parsed-result-item.md)
* [ParsedResult](./interfaces/parsed-result.md)
* [ParsedResultItem](./interfaces/parsed-result-item.md)

## Enumerations

Expand Down
6 changes: 3 additions & 3 deletions programming/javascript/api-reference/code-parser.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ needAutoGenerateSidebar: true

# CodeParser Class

The `CodeParser` class enable users to parse given bytes or a string.
The `CodeParser` class enable users to parse given bytes or a string to be human-readable.

| Method | Description |
| -------------------------------------------- | ---------------------------------------------------------------------- |
Expand Down Expand Up @@ -113,7 +113,7 @@ initSettings: (settings: string) => Promise<void>;

**Return value**

Returns a promise that resolves when the initializing finishes.
A promise that resolves when the operation has completed. It does not provide any value upon resolution.

## resetSettings

Expand All @@ -133,7 +133,7 @@ Returns a promise that resolves when the settings have been successfully reset t

## parse

Parses code data for human-readable results.
Parses a single string to be human-readable.

```typescript
parse: (source: Uint8Array | string, taskSettingName?: string) => Promise<ParsedResultItem>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ interface ParsedResultItem extends Core.CapturedResultItem {
}
```

| API Name | Description |
<!-- | API Name | Description |
| ------------------------------------------------------- | ----------------------------------------------------------------------- |
| [codeType](#codetype) | Returns the code type of the parsed result. |
| [jsonString](#jsonstring) | Returns the parsed result as a JSON formatted string. |
| [getFieldValue()](#getfieldvalue) | Gets the value of a specified field from the parsed result. |
| [getFieldMappingStatus()](#getfieldmappingstatus) | Gets the mapping status of a specified field from the parsed result. |
| [getFieldValidationStatus()](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. |
| [getFieldValidationStatus()](#getfieldvalidationstatus) | Gets the validation status of a specified field from the parsed result. | -->

## codeType

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ interface ParsedResult {
}
```

| API Name | Description |
<!-- | API Name | Description |
| ------------------------------------------- | ----------------------------------------------------------- |
| [originalImageHashId](#originalimagehashid) | Returns the hash id of the original image. |
| [originalImageTag](#originalimagetag) | Returns the tag of the original image. |
| [parsedResultItems](#parsedresultitems) | Returns an array that contains all `ParsedResultItem`s. |
| [hasItem()](#hasitem) | Checks whether the specified `ParsedResultItem` exists. |
| [removeItem()](#removeitem) | Removes the specified `ParsedResultItem`. |
| [errorCode](#errorcode) | Returns the error code for the parsing operation. |
| [errorString](#errorstring) | Returns the error string that corresponds with `errorCode`. |
| [errorString](#errorstring) | Returns the error string that corresponds with `errorCode`. | -->

## originalImageHashId

Expand Down
1 change: 1 addition & 0 deletions programming/javascript/release-notes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ breadcrumbText: Release Notes

# Dynamsoft Code Parser JavaScript SDK - Release Notes

- [2.2.10 (04/11/2024)](js-2.md/#2210-04112024)
- [2.0.20 (01/19/2024)](js-2.md/#2020-01192024)
- [1.1.0 (07/19/2022)](js-1.md/#110-07192022)
- [1.0.2 (06/08/2022)](js-1.md/#102-06082022)
14 changes: 14 additions & 0 deletions programming/javascript/release-notes/js-2.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,20 @@ noTitleIndex: true

# Release Notes for JavaScript SDK - 2.x

## 2.2.10 (04/11/2024)

### Improved

* Security update for `DynamsoftCodeParser` library and other corresponding libraries.

* Update the API [`loadSpec`]({{ site.dcp_js_api }}code-parser-module-class.html#loadspec) to supporting loading multiple specifications at a time.

### Fixed

* Fixed a bug where the same map file is requested more than once.

* Fixed type definition not found issue under TypeScript 5.x version.

## 2.0.20 (01/19/2024)

### Changelog
Expand Down
Loading