From 4b881d09936feba9a98b4dabe2a61159f86413d2 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Mon, 17 Apr 2023 14:24:00 +0800 Subject: [PATCH 1/7] repo seperate --- _config.yml | 45 +++ _data/full_tree.yml | 7 + _data/product_version.yml | 2 + _includes/dcpNav.html | 77 +++++ _includes/sidelist-code-types.html | 9 + _includes/sidelist-development.html | 62 ++++ _includes/sidelist-full-tree.html | 4 + _includes/sidelist-introduction.html | 3 + _includes/sidelist-release-notes.html | 2 + _includes/sidelist-useful.html | 3 + _layouts/default-layout.html | 106 ++++++ _layouts/home-page.html | 50 +++ _layouts/search-page.html | 319 ++++++++++++++++++ code-types/aadhaar.md | 15 + code-types/aamva-dl-id.md | 15 + code-types/index.md | 17 + code-types/mrtd.md | 15 + code-types/sa-dl.md | 15 + code-types/vin.md | 17 + .../api-reference/class/code-parser.md | 172 ++++++++++ .../cplusplus/api-reference/class/index.md | 13 + .../api-reference/class/license-manager.md | 122 +++++++ .../api-reference/class/parsed-result-item.md | 82 +++++ .../api-reference/enum/error-code.md | 55 +++ .../cplusplus/api-reference/enum/index.md | 13 + .../api-reference/enum/mapping-status.md | 31 ++ .../api-reference/enum/validation-status.md | 31 ++ development/cplusplus/api-reference/index.md | 22 ++ development/cplusplus/index.md | 22 ++ development/cplusplus/release-notes/cpp-2.md | 15 + development/cplusplus/release-notes/index.md | 11 + development/cplusplus/user-guide.md | 169 ++++++++++ .../javascript/api-reference/CodeParser.md | 193 +++++++++++ .../api-reference/InitializeEngine.md | 48 +++ .../api-reference/InterfacesEnums.md | 27 ++ .../api-reference/LicenseControl.md | 32 ++ .../api-reference/enum/EnumCodeFormat.md | 21 ++ .../api-reference/enum/EnumErrorCode.md | 34 ++ .../api-reference/enum/EnumResultInfoType.md | 22 ++ .../javascript/api-reference/enum/index.md | 17 + development/javascript/api-reference/index.md | 86 +++++ .../interface/BasicPersonalInfo.md | 66 ++++ .../interface/CodeParserException.md | 19 ++ .../api-reference/interface/ParseResult.md | 25 ++ .../api-reference/interface/index.md | 17 + development/javascript/index.md | 22 ++ development/javascript/release-notes/index.md | 13 + development/javascript/release-notes/js-1.md | 40 +++ development/javascript/user-guide.md | 227 +++++++++++++ faq.md | 8 + index.md | 17 + introduction/index.md | 70 ++++ release-notes/index.md | 62 ++++ search.md | 5 + 54 files changed, 2612 insertions(+) create mode 100644 _config.yml create mode 100644 _data/full_tree.yml create mode 100644 _data/product_version.yml create mode 100644 _includes/dcpNav.html create mode 100644 _includes/sidelist-code-types.html create mode 100644 _includes/sidelist-development.html create mode 100644 _includes/sidelist-full-tree.html create mode 100644 _includes/sidelist-introduction.html create mode 100644 _includes/sidelist-release-notes.html create mode 100644 _includes/sidelist-useful.html create mode 100644 _layouts/default-layout.html create mode 100644 _layouts/home-page.html create mode 100644 _layouts/search-page.html create mode 100644 code-types/aadhaar.md create mode 100644 code-types/aamva-dl-id.md create mode 100644 code-types/index.md create mode 100644 code-types/mrtd.md create mode 100644 code-types/sa-dl.md create mode 100644 code-types/vin.md create mode 100644 development/cplusplus/api-reference/class/code-parser.md create mode 100644 development/cplusplus/api-reference/class/index.md create mode 100644 development/cplusplus/api-reference/class/license-manager.md create mode 100644 development/cplusplus/api-reference/class/parsed-result-item.md create mode 100644 development/cplusplus/api-reference/enum/error-code.md create mode 100644 development/cplusplus/api-reference/enum/index.md create mode 100644 development/cplusplus/api-reference/enum/mapping-status.md create mode 100644 development/cplusplus/api-reference/enum/validation-status.md create mode 100644 development/cplusplus/api-reference/index.md create mode 100644 development/cplusplus/index.md create mode 100644 development/cplusplus/release-notes/cpp-2.md create mode 100644 development/cplusplus/release-notes/index.md create mode 100644 development/cplusplus/user-guide.md create mode 100644 development/javascript/api-reference/CodeParser.md create mode 100644 development/javascript/api-reference/InitializeEngine.md create mode 100644 development/javascript/api-reference/InterfacesEnums.md create mode 100644 development/javascript/api-reference/LicenseControl.md create mode 100644 development/javascript/api-reference/enum/EnumCodeFormat.md create mode 100644 development/javascript/api-reference/enum/EnumErrorCode.md create mode 100644 development/javascript/api-reference/enum/EnumResultInfoType.md create mode 100644 development/javascript/api-reference/enum/index.md create mode 100644 development/javascript/api-reference/index.md create mode 100644 development/javascript/api-reference/interface/BasicPersonalInfo.md create mode 100644 development/javascript/api-reference/interface/CodeParserException.md create mode 100644 development/javascript/api-reference/interface/ParseResult.md create mode 100644 development/javascript/api-reference/interface/index.md create mode 100644 development/javascript/index.md create mode 100644 development/javascript/release-notes/index.md create mode 100644 development/javascript/release-notes/js-1.md create mode 100644 development/javascript/user-guide.md create mode 100644 faq.md create mode 100644 index.md create mode 100644 introduction/index.md create mode 100644 release-notes/index.md create mode 100644 search.md diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..4b36e0c --- /dev/null +++ b/_config.yml @@ -0,0 +1,45 @@ +repositoryUrl: https://github.com/dynamsoft-docs/code-parser-docs/blob/main +repository: Dynamsoft/code-parser-docs +docFullPath: https://www.dynamsoft.com/code-parser/docs +firstLevelUrl: /code-parser/docs/ +docHomePage: /code-parser/docs/introduction/ + +introduction: /code-parser/docs/introduction/ +parameters: /code-parser/docs/parameters/ +enumerations: /code-parser/docs/parameters/enum/ +parameters-reference: /code-parser/docs/parameters/reference/ + +development: /code-parser/docs/development/ + +cpp: /code-parser/docs/development/cplusplus/ +cpp_api: /code-parser/docs/development/cplusplus/api-reference/ +cpp_class: /code-parser/docs/development/cplusplus/api-reference/class/ +cpp_enum: /code-parser/docs/development/cplusplus/api-reference/enum/ +cpp_release_notes: /code-parser/docs/development/cplusplus/release-notes/ + + +javascript: /code-parser/docs/development/javascript/ +javascript-api: /code-parser/docs/development/javascript/api-reference/ +javascript-api-enum: /code-parser/docs/development/javascript/api-reference/enum/ +javascript-api-interface: /code-parser/docs/development/javascript/api-reference/interface/ +javascript-release-notes: /code-parser/docs/development/javascript/release-notes/ + +assets: /code-parser/docs/assets/ +edit_icon: /code-parser/docs/assets/img-icon/edit-icon.png +smile_icon: /code-parser/docs/assets/img-icon/icon-smile.png +sad_icon: /code-parser/docs/assets/img-icon/icon-sad.png +dbr_icon: /code-parser/docs/assets/img-icon/icon-dbr.svg +dwt_icon: /code-parser/docs/assets/img-icon/icon-dwt.svg +dnt_icon: /code-parser/docs/assets/img-icon/icon-dnt.svg + +release-notes: /code-parser/docs/release-notes/ +code_types: /code-parser/docs/code-types/ + +useVersionTree: true + +baseurl: "/code-parser/docs" +plugins: + - jemoji + +url: "https://www.dynamsoft.com" # sitemap root + diff --git a/_data/full_tree.yml b/_data/full_tree.yml new file mode 100644 index 0000000..8f2e396 --- /dev/null +++ b/_data/full_tree.yml @@ -0,0 +1,7 @@ +tree_file_list: + - sidelist-full-tree.html + - sidelist-code-types.html + - sidelist-development.html + - sidelist-introduction.html + - sidelist-release-notes.html + - sidelist-useful.html diff --git a/_data/product_version.yml b/_data/product_version.yml new file mode 100644 index 0000000..4843c0d --- /dev/null +++ b/_data/product_version.yml @@ -0,0 +1,2 @@ +version_info_list: + - latest version diff --git a/_includes/dcpNav.html b/_includes/dcpNav.html new file mode 100644 index 0000000..889d6ca --- /dev/null +++ b/_includes/dcpNav.html @@ -0,0 +1,77 @@ + + +
+
+
+
+ +
+
+
+
+
+ +
Resource Base
+
+
+
+
+
+ +
+
+
+
\ No newline at end of file diff --git a/_includes/sidelist-code-types.html b/_includes/sidelist-code-types.html new file mode 100644 index 0000000..138eeac --- /dev/null +++ b/_includes/sidelist-code-types.html @@ -0,0 +1,9 @@ +
  • Supported Code Types + +
  • \ No newline at end of file diff --git a/_includes/sidelist-development.html b/_includes/sidelist-development.html new file mode 100644 index 0000000..38dd206 --- /dev/null +++ b/_includes/sidelist-development.html @@ -0,0 +1,62 @@ +
  • DEVELOPMENT
  • +
  • Web (Client Side) + + +
  • +
  • + Server / Desktop + +
  • \ No newline at end of file diff --git a/_includes/sidelist-full-tree.html b/_includes/sidelist-full-tree.html new file mode 100644 index 0000000..ca6416e --- /dev/null +++ b/_includes/sidelist-full-tree.html @@ -0,0 +1,4 @@ +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-introduction.html" -%} +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-development.html" -%} +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-useful.html" -%} + diff --git a/_includes/sidelist-introduction.html b/_includes/sidelist-introduction.html new file mode 100644 index 0000000..6546aec --- /dev/null +++ b/_includes/sidelist-introduction.html @@ -0,0 +1,3 @@ +
  • + Introduction +
  • \ No newline at end of file diff --git a/_includes/sidelist-release-notes.html b/_includes/sidelist-release-notes.html new file mode 100644 index 0000000..4ba0145 --- /dev/null +++ b/_includes/sidelist-release-notes.html @@ -0,0 +1,2 @@ +
  • Release Notes +
  • \ No newline at end of file diff --git a/_includes/sidelist-useful.html b/_includes/sidelist-useful.html new file mode 100644 index 0000000..c89463b --- /dev/null +++ b/_includes/sidelist-useful.html @@ -0,0 +1,3 @@ +
  • USEFUL RESOURCES
  • +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-release-notes.html" -%} +{%- include liquid_searchVersionTreeFile.html ver=include.ver curPath=include.curPath targetRelativePath="sidelist-code-types.html" -%} \ No newline at end of file diff --git a/_layouts/default-layout.html b/_layouts/default-layout.html new file mode 100644 index 0000000..601e0d7 --- /dev/null +++ b/_layouts/default-layout.html @@ -0,0 +1,106 @@ + + + +{%- include head.html -%} + + +
    + {%- include page_header.html -%} +
    + {%- include dcpNav.html -%} +
    Table of contents
    +
    +
    + +
    +
    + {%- include main-page-head.html -%} +
    +
    +
    + {{ content }} +
    +
    +
    +

    This page is compatible for:

    +

    Version 1.0

    +
    +
    +

    Is this page helpful?

    + YesYes + NoNo +
    +
    + {%- if page.needAutoGenerateSidebar -%} +

    In this article:

    +
    + {%- endif -%} +
    +
    + +
    +
    +
    +
    +
    +
    + {%- include liquid_autoGenerateHistoryList.html -%} + {%- include auto-version-list.html -%} +
    +
    +
    +
    + {%- include page_footer.html -%} +
    + + + + + + + + + + {%- include livehelp.html -%} + + + + + + + + + + + diff --git a/_layouts/home-page.html b/_layouts/home-page.html new file mode 100644 index 0000000..a3a268e --- /dev/null +++ b/_layouts/home-page.html @@ -0,0 +1,50 @@ + + + +{%- include head.html -%} + + + + +
    + {%- include page_header.html -%} +
    +
    +
    +
    + + {{ content }} +
    +
    +
    +
    + {%- include page_footer.html -%} +
    + + + + + + + diff --git a/_layouts/search-page.html b/_layouts/search-page.html new file mode 100644 index 0000000..c625344 --- /dev/null +++ b/_layouts/search-page.html @@ -0,0 +1,319 @@ + + + +{%- include head.html -%} + + + +
    + {%- include page_header.html -%} +
    +
    +
    +
    + +
    +
    +
    +
    + +
    Documentation
    +
    +
    +
    +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    Table of contents
    +
    +
    +
    +
    +
    +
    +
    +

    Search

    + + +
    +
    +
    + +
    +
    +
    +
    +
    + {%- include page_footer.html -%} +
    + + + + + {%- if page.needAutoGenerateSidebar -%} + {%- unless page.needGenerateH3Content -%} + + {%- else -%} + + {%- endunless -%} + {%- else -%} + + {%- endif -%} + + + + {%- include livehelp.html -%} + + + \ No newline at end of file diff --git a/code-types/aadhaar.md b/code-types/aadhaar.md new file mode 100644 index 0000000..5eb7c4b --- /dev/null +++ b/code-types/aadhaar.md @@ -0,0 +1,15 @@ +--- +layout: default-layout +title: Machine Readable Travel Documents - Supported Code Types +description: This page shows the details of code type Machine Readable Travel Documents. +keywords: mrtd, code types +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# Aadhaar + +## Overview + +## Fields diff --git a/code-types/aamva-dl-id.md b/code-types/aamva-dl-id.md new file mode 100644 index 0000000..4ac2b08 --- /dev/null +++ b/code-types/aamva-dl-id.md @@ -0,0 +1,15 @@ +--- +layout: default-layout +title: Machine Readable Travel Documents - Supported Code Types +description: This page shows the details of code type Machine Readable Travel Documents. +keywords: mrtd, code types +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# North America DL/ID + +## Overview + +## Fields diff --git a/code-types/index.md b/code-types/index.md new file mode 100644 index 0000000..e96c908 --- /dev/null +++ b/code-types/index.md @@ -0,0 +1,17 @@ +--- +layout: default-layout +title: Supported code types - Dynamsoft Code Parser SDK +description: This is the supported code types page of Dynamsoft Code Parser SDK. +keywords: code types +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# Supported Code Types + +* [Machine Readable Travel Documents](mrtd.md) +* [North America DL/ID](aamva-dl-id.md) +* [South Africa Driver License](sa-dl.md) +* [Aadhaar](aadhaar.md) +* [Vehicle Identification Number](vin.md) diff --git a/code-types/mrtd.md b/code-types/mrtd.md new file mode 100644 index 0000000..56092c4 --- /dev/null +++ b/code-types/mrtd.md @@ -0,0 +1,15 @@ +--- +layout: default-layout +title: Machine Readable Travel Documents - Supported Code Types +description: This page shows the details of code type Machine Readable Travel Documents. +keywords: mrtd, code types +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# Machine Readable Travel Documents + +## Overview + +## Fields diff --git a/code-types/sa-dl.md b/code-types/sa-dl.md new file mode 100644 index 0000000..f8ddb06 --- /dev/null +++ b/code-types/sa-dl.md @@ -0,0 +1,15 @@ +--- +layout: default-layout +title: Machine Readable Travel Documents - Supported Code Types +description: This page shows the details of code type Machine Readable Travel Documents. +keywords: mrtd, code types +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# South Africa Driver License + +## Overview + +## Fields diff --git a/code-types/vin.md b/code-types/vin.md new file mode 100644 index 0000000..f7931cb --- /dev/null +++ b/code-types/vin.md @@ -0,0 +1,17 @@ +--- +layout: default-layout +title: Machine Readable Travel Documents - Supported Code Types +description: This page shows the details of code type Machine Readable Travel Documents. +keywords: mrtd, code types +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# Vehicle Identification Number + +## Overview + +The parser supports all standards of the Vehicle Identification Number (VIN). + +## Fields diff --git a/development/cplusplus/api-reference/class/code-parser.md b/development/cplusplus/api-reference/class/code-parser.md new file mode 100644 index 0000000..d875254 --- /dev/null +++ b/development/cplusplus/api-reference/class/code-parser.md @@ -0,0 +1,172 @@ +--- +layout: default-layout +title: CCodeParser Class - Dynamsoft Code Parser SDK C++ Edition API Reference +description: This page shows CCodeParser Class of Dynamsoft Code Parser SDK C++ Edition. +keywords: CCodeParser, api reference, c++ +needAutoGenerateSidebar: true +--- + +# CCodeParser Class + + | Method | Description | + |----------------------|-------------| + | [`CCodeParser`](#constructor) | Default constructor of `CCodeParser` object.| + | [`~CCodeParser`](#destructor) | Destructor of `CCodeParser` object.| + | [`GetVersion`](#getversion) | Get version information of SDK.| + | [`InitSettingsFromFile`](#initsettingsfromfile) | Initialize runtime settings with the settings in a given JSON file. | + | [`InitSettings`](#initsettings) | Initialize runtime settings with the settings in a given JSON string. | + | [`Parse`](#parse) | Parses code data for readable results. | + | [`ResetSettings`](#resetsettings) | Reset runtime settings to default. | + +## CCodeParser {#constructor} + +Default constructor of a `CCodeParser` object. + +```cpp +dynamsoft::dcp::CCodeParser::CCodeParser() +``` + +## ~CCodeParser {#destructor} + +Destructor of a `CCodeParser` object. + +```cpp +dynamsoft::dcp::CCodeParser::~CCodeParser() +``` + +## GetVersion + +Get version information of SDK. + +```cpp +static const char* dynamsoft::dcp::CCodeParser::GetVersion() +``` + +**Return Value** + +The version information string. + +**Code Snippet** + +```cpp +const char* versionInfo = dynamsoft::dcp::CCodeParser::GetVersion(); +``` + +## Parse + +Parses code data for human-readable results. + +```cpp +CParsedResultItem* dynamsoft::dcp::CCodeParser::Parse(const unsigned char* pData, int length, const char* taskSettingName="", int* errorCode = NULL) +``` + +**Parameters** + +`[in] pData` The array of bytes which contain the code string. +`[in] length` The length of the code string bytes. +`[in] taskSettingName`Optional The name of [`CodeParserTaskSetting`]({{site.parameters}}code-parser-task-setting-options.html) which defines the settings used for code parsing. +`[in,out] errorCode`Optional The error code. + +**Return Value** + +Returns [`CParsedResultItem`](parsed-result-item.md) which stores the human-readable results. + +**Code Snippet** + + +```cpp +char errorBuf[512]; +dynamsoft::dcp::CCodeParser::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +//get code string data (pData, length) somewhere else +CParsedResultItem* dcpResult = dcp->Parse(pData, length); +cout << "CodeType: " << dcpResult->GetCodeType() << endl; +delete dcpResult; +delete dcp; +``` + +## ResetSettings + +Reset all parameters to default values. + +```cpp +int dynamsoft::dcp::CCodeParser::ResetSettings() +``` + +**Return Value** + +Returns error code. + +**Code Snippet** + + +```cpp +char errorBuf[512]; +dynamsoft::dcp::CCodeParser::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +dcp->ResetSettings(); +dcp->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", errorBuf, 512); +// Do something with dcp object +delete dcp; +``` + +## InitSettingsFromFile + +Initialize settings from a given file. + +```cpp +int dynamsoft::dcp::CCodeParser::InitSettingsFromFile(const char* filePath, char errorMsgBuffer[] = NULL, int errorMsgBufferLen = 0) +``` + +**Parameters** + +`[in] filePath` The path of the settings file. +`[in,out] errorMsgBuffer`Optional The buffer is allocated by caller and the recommended length is 512. The error message will be copied to the buffer. +`[in] errorMsgBufferLen`Optional The length of the allocated buffer. + +**Return Value** + +Returns error code. + +**Code Snippet** + +```cpp +char errorBuf[512]; +dynamsoft::dcp::CCodeParser::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +dcp->ResetSettings(); +dcp->InitSettingsFromFile("PATH-TO-YOUR-SETTING-FILE", errorBuf, 512); +// Do something with dcp object +delete dcp; +``` + +## InitSettings + +Initialize settings from a given string. + +```cpp +int dynamsoft::dcp::CCodeParser::InitSettings (const char* content, char errorMsgBuffer[] = NULL, int errorMsgBufferLen = 0) +``` + +**Parameters** + +`[in] content` A JSON string that represents the content of the settings. +`[in,out] errorMsgBuffer`Optional The buffer is allocated by caller and the recommended length is 512. The error message will be copied to the buffer. +`[in] errorMsgBufferLen`Optional The length of the allocated buffer. + +**Return Value** + +Returns error code. + +**Code Snippet** + + +```cpp +char errorBuf[512]; +dynamsoft::dcp::CCodeParser::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +dcp->ResetSettings(); +dcp->InitSettings("YOUR-SETTING-STRING", errorBuf, 512); +// Do something with dcp object +delete dcp; +``` diff --git a/development/cplusplus/api-reference/class/index.md b/development/cplusplus/api-reference/class/index.md new file mode 100644 index 0000000..d1b8f9a --- /dev/null +++ b/development/cplusplus/api-reference/class/index.md @@ -0,0 +1,13 @@ +--- +layout: default-layout +title: Classes - Dynamsoft Code Parser SDK C++ Edition API Reference +description: This page shows classes of Dynamsoft Code Parser SDK C++ Edition. +keywords: classes, api reference, c++ +needAutoGenerateSidebar: true +--- + +# Classes + +* [`CCodeParser`](code-parser.md) +* [`CLicenseManager`](license-manager.md) +* [`CParsedResultItem`](parsed-result-item.md) diff --git a/development/cplusplus/api-reference/class/license-manager.md b/development/cplusplus/api-reference/class/license-manager.md new file mode 100644 index 0000000..ed2c596 --- /dev/null +++ b/development/cplusplus/api-reference/class/license-manager.md @@ -0,0 +1,122 @@ +--- +layout: default-layout +title: CLicenseManager Class - Dynamsoft Code Parser SDK C++ Edition API Reference +description: This page shows CLicenseManager Class of Dynamsoft Code Parser SDK C++ Edition. +keywords: CLicenseManager, api reference, c++ +needAutoGenerateSidebar: true +--- + + +# CLicenseManager Class + +```cpp +class dynamsoft::license::CLicenseManager +``` + + | Method | Description | + |----------------------|-------------| + | [`InitLicense`](#initlicense) | Initializes license key and activate the SDK. | + | [`GetDeviceUUID`](#getdeviceuuid) | Gets the device uuid used for license activating. | + | [`SetDeviceFriendlyName`](#setdevicefriendlyname) | Sets a human-readable name that identifies the device. | + | [`SetLicenseCachePath`](#setlicensecachepath) | Sets a directory path for saving the license cache. | + +## InitLicense + +Initializes license key and activate the SDK. + +```cpp +static int dynamsoft::license::CLicenseManager::InitLicense(const char* pLicense, char errorMsgBuffer[] = NULL, const int errorMsgBufferLen = 0) +``` + +**Parameters** + +`[in] pLicense` The license key. +`[in, out] errorMsgBuffer` The buffer is allocated by caller and the recommended length is 512. The error message will be copied to the buffer. +`[in] errorMsgBufferLen` The length of allocated buffer. + +**Return Value** + +Returns error code. + +**Code Snippet** + +```cpp +char errorBuf[512]; +dynamsoft::license::CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +// do something with dcp object +``` + +## GetDeviceUUID + +Gets the device uuid used for license activating. + +```cpp +static int dynamsoft::license::CLicenseManager::GetDeviceUUID(int uuidGenerationMethod, char uuidBuffer[], const int uuidBufferLen) +``` + +**Parameters** + +`[in] uuidGenerationMethod` The method used to generate the UUID. + +- 1: Generates UUID with random values. +- 2: Generates UUID based on hardware info. + +`[in, out] uuidBuffer` The buffer is allocated by caller and the recommended length is 36. The UUID will be copied to the buffer. +`[in] uuidBufferLen` The length of allocated buffer. + +**Return Value** + +Returns error code. + +## SetDeviceFriendlyName + +Sets a human-readable name that identifies the device. + +```cpp +static int dynamsoft::license::CLicenseManager::SetDeviceFriendlyName(const char* name) +``` + +**Parameters** + +`[in] name` The device alias. + +**Return Value** + +Returns error code. + +**Code Snippet** + +```cpp +char errorBuf[512]; +dynamsoft::license::CLicenseManager::SetDeviceFriendlyName("My-PC"); +dynamsoft::license::CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +// do something with dcp object +``` + +## SetLicenseCachePath + +Sets a directory path for saving the license cache. + +```cpp +static int dynamsoft::license::CLicenseManager::SetLicenseCachePath(const char* directoryPath) +``` + +**Parameters** + +`[in] directoryPath` The directory path where to save the license cache. + +**Return Value** + +Returns error code. + +**Code Snippet** + +```cpp +char errorBuf[512]; +dynamsoft::license::CLicenseManager::SetLicenseCachePath("DIRECTORY-PATH-FOR-LICENSE-CACHE"); +dynamsoft::license::CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); +CCodeParser* dcp = new CCodeParser(); +// do something with dcp object +``` diff --git a/development/cplusplus/api-reference/class/parsed-result-item.md b/development/cplusplus/api-reference/class/parsed-result-item.md new file mode 100644 index 0000000..9733ac6 --- /dev/null +++ b/development/cplusplus/api-reference/class/parsed-result-item.md @@ -0,0 +1,82 @@ +--- +layout: default-layout +title: CParsedResultItem Class - Dynamsoft Code Parser SDK C++ Edition API Reference +description: This page shows CParsedResultItem Class of Dynamsoft Code Parser SDK C++ Edition. +keywords: CParsedResultItem, api reference, c++ +needAutoGenerateSidebar: true +--- + + +# CParsedResultItem Class + +```cpp +class dynamsoft::dcp::CParsedResultItem +``` + + | Method | Description | + |----------------------|-------------| + | [`GetCodeType`](#getcodetype) | Get all recognized barcode results. | + | [`GetFieldMappingStatus`](#getfieldmappingstatus) | Get intermediate results. | + | [`GetFieldValidationStatus`](#getfieldvalidationstatus) | Free memory allocated for the intermediate results. | + | [`GetFieldValue`](#getfieldvalue) | Free memory allocated for text results. | + | [`GetJsonString`](#getjsonstring) | Get all recognized barcode results. | + +## GetCodeType + +Gets the code type of the parsed result. + +```cpp +const char* dynamsoft::dcp::CParsedResultItem::GetCodeType() +``` + +## GetJsonString + +Gets the parsed result as a JSON formatted string. + +```cpp +const char* dynamsoft::dcp::CParsedResultItem::GetJsonString() +``` + +## GetFieldValue + +Gets the value of a specified field from the parsed result. + +```cpp +const char* dynamsoft::dcp::CParsedResultItem::GetFieldValue (const char* fieldName) +``` + +**Parameters** + +`[in] fieldName` The name of the field. + +## GetFieldMappingStatus + +Gets the mapping status of a specified field from the parsed result. + +```cpp +MappingStatus dynamsoft::dcp::CParsedResultItem::GetFieldMappingStatus(const char* fieldName) +``` + +**Parameters** + +`[in] fieldName` The name of the field. + +**See Also** + +[MappingStatus]({{site.cpp_enum}}mapping-status.html) + +## GetFieldValidationStatus + +Gets the validation status of a specified field from the parsed result. + +```cpp +ValidationStatus dynamsoft::dcp::CParsedResultItem::GetFieldValidationStatus(const char* fieldName) +``` + +**Parameters** + +`[in] fieldName` The name of the field. + +**See Also** + +[ValidationStatus]({{site.cpp_enum}}validation-status.html) diff --git a/development/cplusplus/api-reference/enum/error-code.md b/development/cplusplus/api-reference/enum/error-code.md new file mode 100644 index 0000000..bd332e7 --- /dev/null +++ b/development/cplusplus/api-reference/enum/error-code.md @@ -0,0 +1,55 @@ +--- +layout: default-layout +title: ErrorCode - Dynamsoft Code Parser SDK C++ Edition Enumeration +description: This page shows the ErrorCode Enumeration of Dynamsoft Code Parser SDK C++ Edition. +keywords: ErrorCode, Enumeration +needAutoGenerateSidebar: false +needGenerateH3Content: false +--- + +# ErrorCode Enumeration + +Describes the mapping status for a parsed field. + +## Declarations + +```cpp +typedef enum ErrorCode +{ + EC_OK, + //other members +} ErrorCode; +``` + +## Members + +| Member | Description | +| ------ | ----------- | +| EC_OK | Successful. | +| EC_FILE_NOT_FOUND | The file is not found. | +| EC_JSON_PARSE_FAILED | Failed to parse JSON string. | +| EC_JSON_TYPE_INVALID | The value type is invalid. | +| EC_JSON_KEY_INVALID | The key is invalid. | +| EC_JSON_VALUE_INVALID | The value is invalid or out of range. | +| EC_JSON_NAME_KEY_MISSING | The mandatory key "Name" is missing. | +| EC_JSON_NAME_VALUE_DUPLICATED | The value of the key "Name" is duplicated. | +| EC_TEMPLATE_NAME_INVALID | The template name is invalid. | +| EC_NO_LICENSE | No license specified. | +| EC_LICENSE_BUFFER_FAILED | Failed to read or write license buffer. | +| EC_LICENSE_SYNC_FAILED | Failed to synchronize license info with License Server. | +| EC_DEVICE_NOT_MATCH | Device does not match with license buffer. | +| EC_BIND_DEVICE_FAILED | Failed to bind device. | +| EC_LICENSE_CLIENT_DLL_MISSING | The license client dll is missing. | +| EC_TRIAL_LICENSE | Using a trial license. | +| EC_FAILED_TO_REACH_DLS | Failed to reach License Server. | +| EC_RESOURCE_PATH_NOT_EXIST | The resource path does not exist. | +| EC_RESOURCE_LOAD_FAILED | The full code string is empty. | +| EC_CODE_SPECIFICATION_NOT_FOUND | The code specification is not found. | +| EC_FULL_CODE_EMPTY | The full code string is empty. | +| EC_FULL_CODE_PREPROCESS_FAILED | Failed to preprocess the full code string. | +| EC_ZA_DL_LICENSE_INVALID | The license for parsing South Africa Driver License is invalid. | +| EC_AAMVA_DL_ID_LICENSE_INVALID | The license for parsing North America DL/ID is invalid. | +| EC_AADHAAR_LICENSE_INVALID | The license for parsing Aadhaar is invalid. | +| EC_MRTD_LICENSE_INVALID | The license for parsing Machine Readable Travel Documents is invalid. | +| EC_VIN_LICENSE_INVALID | The license for parsing Vehicle Identification Number is invalid. | +| EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID | The license for parsing customized code type is invalid. | diff --git a/development/cplusplus/api-reference/enum/index.md b/development/cplusplus/api-reference/enum/index.md new file mode 100644 index 0000000..4dd0d14 --- /dev/null +++ b/development/cplusplus/api-reference/enum/index.md @@ -0,0 +1,13 @@ +--- +layout: default-layout +title: Enumerations - Dynamsoft Code Parser SDK C++ Edition API Reference +description: This page shows Enumerations of Dynamsoft Code Parser SDK C++ Edition. +keywords: Enumerations, api reference, c++ +needAutoGenerateSidebar: true +--- + +# Enumerations + +* [`ErrorCode`](error-code.md) +* [`MappingStatus`](mapping-status.md) +* [`ValidationStatus`](validation-status.md) diff --git a/development/cplusplus/api-reference/enum/mapping-status.md b/development/cplusplus/api-reference/enum/mapping-status.md new file mode 100644 index 0000000..945d64f --- /dev/null +++ b/development/cplusplus/api-reference/enum/mapping-status.md @@ -0,0 +1,31 @@ +--- +layout: default-layout +title: MappingStatus - Dynamsoft Code Parser SDK C++ Edition Enumeration +description: This page shows the MappingStatus Enumeration of Dynamsoft Code Parser SDK C++ Edition. +keywords: MappingStatus, Enumeration +needAutoGenerateSidebar: false +needGenerateH3Content: false +--- + +# MappingStatus Enumeration + +Describes the mapping status for a parsed field. + +## Declarations + +```cpp +typedef enum MappingStatus +{ + MS_NONE, + MS_SUCCEEDED, + MS_FAILED +} MappingStatus; +``` + +## Members + +| Member | Description | +| ------ | ----------- | +| MS_NONE | The field has no mapping specified. | +| MS_SUCCEEDED | Find a mapping for the field value. | +| MS_FAILED | Failed to find a mapping for the field value. | diff --git a/development/cplusplus/api-reference/enum/validation-status.md b/development/cplusplus/api-reference/enum/validation-status.md new file mode 100644 index 0000000..689603c --- /dev/null +++ b/development/cplusplus/api-reference/enum/validation-status.md @@ -0,0 +1,31 @@ +--- +layout: default-layout +title: ValidationStatus - Dynamsoft Code Parser SDK C++ Edition Enumeration +description: This page shows the ValidationStatus Enumeration of Dynamsoft Code Parser SDK C++ Edition. +keywords: ValidationStatus, Enumeration +needAutoGenerateSidebar: false +needGenerateH3Content: false +--- + +# ValidationStatus Enumeration + +Describes the validation status for a parsed field. + +## Declarations + +```cpp +typedef enum ValidationStatus +{ + VS_NONE, + VS_SUCCEEDED, + VS_FAILED +} ValidationStatus; +``` + +## Members + +| Member | Description | +| ------ | ----------- | +| VS_NONE | The field has no validation specified. | +| VS_SUCCEEDED | The validation for the field has been succeeded. | +| VS_FAILED | The validation for the field has been failed. | diff --git a/development/cplusplus/api-reference/index.md b/development/cplusplus/api-reference/index.md new file mode 100644 index 0000000..8641ba5 --- /dev/null +++ b/development/cplusplus/api-reference/index.md @@ -0,0 +1,22 @@ +--- +layout: default-layout +title: Main Page - Dynamsoft Code Parser SDK C++ Edition API Reference +description: This is the main page of Dynamsoft Code Parser SDK C++ Edition API Reference. +keywords: api reference, c++ +needAutoGenerateSidebar: true +needGenerateH3Content: true +--- + +# API Reference - Dynamsoft Code Parser SDK C++ Edition + +## Classes + +* [`CCodeParser`](class/code-parser.md) +* [`CLicenseManager`](class/license-manager.md) +* [`CParsedResultItem`](class/parsed-result-item.md) + +## Enumerations + +* [`ErrorCode`](enum/error-code.md) +* [`MappingStatus`](enum/mapping-status.md) +* [`ValidationStatus`](enum/validation-status.md) diff --git a/development/cplusplus/index.md b/development/cplusplus/index.md new file mode 100644 index 0000000..3f2cb83 --- /dev/null +++ b/development/cplusplus/index.md @@ -0,0 +1,22 @@ +--- +layout: default-layout +title: Main Page - Dynamsoft Code Parser SDK C++ Edition +description: This is the main page of Dynamsoft Code Parser SDK C++ Edition. +keywords: c++ +needAutoGenerateSidebar: true +needGenerateH3Content: true +--- + +# Dynamsoft Code Parser C++ Edition Documentation + +## Getting Started + +- [User Guide](user-guide.md) + +## API Reference + +- [API Reference](api-reference/index.md) + +## Release Notes + +- [Version 2.x](release-notes/cpp-2.md) diff --git a/development/cplusplus/release-notes/cpp-2.md b/development/cplusplus/release-notes/cpp-2.md new file mode 100644 index 0000000..6a42e90 --- /dev/null +++ b/development/cplusplus/release-notes/cpp-2.md @@ -0,0 +1,15 @@ +--- +layout: default-layout +title: Release Notes v2.x - Dynamsoft Code Parser SDK C++ Edition +description: This is the release notes page of Dynamsoft Code Parser SDK C++ Edition v2.x. +keywords: release notes, c++ +needGenerateH3Content: false +--- + +# Release Notes for C++ Edition - 2.x + +## 2.0.0 (04/30/2023) + +### Highlights + +[TODO] diff --git a/development/cplusplus/release-notes/index.md b/development/cplusplus/release-notes/index.md new file mode 100644 index 0000000..062e872 --- /dev/null +++ b/development/cplusplus/release-notes/index.md @@ -0,0 +1,11 @@ +--- +layout: default-layout +title: Release Notes - Dynamsoft Code Parser SDK C++ Edition +description: This is the release notes page of Dynamsoft Code Parser SDK C++ Edition. +keywords: release notes, c++ +needAutoGenerateSidebar: false +--- + +# Release Notes - C++ Edition + +- [2.0.0 (04/30/2023)](cpp-2.md#200-04302023) diff --git a/development/cplusplus/user-guide.md b/development/cplusplus/user-guide.md new file mode 100644 index 0000000..44118b2 --- /dev/null +++ b/development/cplusplus/user-guide.md @@ -0,0 +1,169 @@ +--- +layout: default-layout +title: User Guide - Dynamsoft Code Parser SDK C++ Edition +description: This is the user guide of Dynamsoft Code Parser SDK C++ Edition. +keywords: user guide, c++ +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +--- + +# Getting Started with C++ Edition + +In this guide, you will learn step by step on how to build a code parsing application with Dynamsoft Code Parser SDK using C++ language. + +## Requirements + +- Operating System: + - Windows 7, 8, 10, 11, 2003, 2008, 2008 R2, 2012, 2016, 2019, 2022 + - Linux x64: Ubuntu 14.04.4+ LTS, Debian 8+, etc + +- Developing Tool + - Visual Studio 2008 or above + - G++ 5.4+ + +>Note: +>Dynamsoft Code Parser provides both online and offline license options. The online license option might not work in an environment that doesn't have network connection. In such case, you can get an offline trial license key via Customer Portal or by contacting us. + +## Installation + +If you haven't downloaded the SDK yet, download the `C/C++ Package` now from Dynamsoft website and unpack the package into the directory of your choice. +>For this tutorial, we unpack it to `[INSTALLATION FOLDER]`, change it to your unpacking path for the following content. + +## Build Your First Application + +Let's start by creating a console application which demonstrates how to use the minimum code to get the human-readable information from the code string. +> You can download the entire source code here. + +### Create a New Project + +#### For Windows + +1. Open Visual Studio. Go to File > New > Project, create a new Empty Project and set Project name as `DCPSample`. + +2. Add a new source file named `DCPSample.cpp` into the project. + +#### For Linux/ARM/Mac + +1. Create a new source file named `DCPSample.cpp` and place it into the folder `[INSTALLATION FOLDER]/Samples`. + +### Include the Library + +1. Add headers and libs in `DCPSample.cpp`. + + ```cpp + #include + #include "[INSTALLATION FOLDER]/Include/DynamsoftCodeParser.h" + #include "[INSTALLATION FOLDER]/Include/DynamsoftCore.h" + #include "[INSTALLATION FOLDER]/Include/DynamsoftLicense.h" + using namespace std; + using namespace dynamsoft::dcp; + using namespace dynamsoft::license; + #if defined(_WIN64) || defined(_WIN32) + #ifdef _WIN64 + #pragma comment(lib, "[INSTALLATION FOLDER]/Lib/Windows/x64/DynamsoftCodeParserx64.lib") + #pragma comment(lib, "[INSTALLATION FOLDER]/Lib/Windows/x64/DynamsoftCorex64.lib") + #pragma comment(lib, "[INSTALLATION FOLDER]/Lib/Windows/x64/DynamsoftLicensex64.lib") + #else + #pragma comment(lib, "[INSTALLATION FOLDER]/Lib/Windows/x86/DynamsoftCodeParserx86.lib") + #pragma comment(lib, "[INSTALLATION FOLDER]/Lib/Windows/x86/DynamsoftCorex86.lib") + #pragma comment(lib, "[INSTALLATION FOLDER]/Lib/Windows/x86/DynamsoftLicensex86.lib") + #endif + #endif + ``` + +### Initialize a Code Parser Instance + +1. Initialize the license key. + + ```cpp + int errorCode = 0; + char errorBuf[512]; + errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); + if (errorCode != EC_OK) + { + // Add your code for license error processing; + cout << errorBuf << endl; + } + ``` + + >Please replace `YOUR-LICENSE-KEY` with a valid DCP licensekey. There are two ways to obtain one: + >- Search `InitLicense` and find the license from `[INSTALLATION FOLDER]/Samples/HelloWorld/HelloWorld.cpp`. + >- Request a trial license from Customer Portal. + +2. Create an instance of Dynamsoft Code Parser. + + ```cpp + CCodeParser* dcp = new CCodeParser(); + ``` + +### Parse and Output Results + +1. Parse a code string. + + ```cpp + int errorCode = -1; + //get codeString and codeStringLenght somewhere else + CParsedResultItem* dcpResult = dcp->Parse(codeString, codeStringLenght, "", &errorCode); + ``` + +2. Get and output results. + + ```cpp + if (dcpResult != NULL) + { + cout << "CodeType: " << dcpResult->GetCodeType() << endl; + cout << "Value of A-SPECIFIC-FIELD-NAME: " << dcpResult->GetFieldValue("A-SPECIFIC-FIELD-NAME") << endl; + } + ``` + + >Please replace `A-SPECIFIC-FIELD-NAME` to a specific field name based on the code string you are parsing. Check out [Supported Code Types and Fields]({{ site.code_types }}) for details. + +### Release Allocated Memory + +1. Release the allocated memory for the barcode results. + + ```cpp + if (dcpResult != NULL) + delete dcpResult; + ``` + +2. Release the allocated memory for the instance. + + ```cpp + if (dcp != NULL) + delete dcp; + ``` + +>Note: +Please change all `[INSTALLATION FOLDER]` in above code snippet to your unpacking path. + +### Build and Run the Project + +#### For Windows + +1. In Visual Studio, set the solution to build as Release\|x64. + +2. Build the project to generate program `DCPSample.exe`. + +3. Copy **ALL** `*.dll` files under `[INSTALLATION FOLDER]\Lib\Windows\x64` to the same folder as the `DCPSample.exe`. + +4. Run the program `DCPSample.exe`. + +>The SDK supports both x86 and x64, please set the platform based on your needs. + +#### For Linux + +1. Open a terminal and change to the target directory where `DCPSample.cpp` located in. Build the sample: + + ```bash + g++ -o DCPSample DCPSample.cpp -lDynamsoftCodeParser -lDynamsoftCore -lDynamsoftLicense -L ../Lib/Linux -Wl,-rpath=../Lib/Linux -std=c++11 + ``` + +2. Run the program `DCPSample`. + + ```bash + ./DCPSample + ``` + +> You can download the entire source code here. diff --git a/development/javascript/api-reference/CodeParser.md b/development/javascript/api-reference/CodeParser.md new file mode 100644 index 0000000..3f91e0c --- /dev/null +++ b/development/javascript/api-reference/CodeParser.md @@ -0,0 +1,193 @@ +--- +layout: default-layout +title: CodeParser - Dynamsoft Code Parser JavaScript API +description: This is the CodeParser Class of Dynamsoft Code Parser JavaScript SDK. +keywords: CodeParser, api reference, javascript, js +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +breadcrumbText: CodeParser +--- + +# CodeParser + +A CodeParser takes code data in forms of byte array or plain string as input and returns parsed results. The following code snippet shows its basic usage: + +```js +let parser = await Dynamsoft.DCP.CodeParser.createInstance(); +parser.setCodeFormat(enumcodeformat); +let result = await parser.parseData(code); +console.log(result); +``` + +## API Index + +### Create and Destroy + +| API Name | Description | +|---|---| +| [createInstance()](#createinstance) | Creates a `CodeParser` instance. | +| [destroyContext()](#destroycontext) | Destroys the `CodeParser` instance in WASM. | + +### Set Code Format + +| API Name | Description | +|---|---| +| [setCodeFormat()](#setcodeformat) | Sets input code's format. | + +### Parse Code Data + +| API Name | Description | +|---|---| +| [parseData()](#parsedata) | Parses code data for readable results. | + + + + +## createInstance + +Creates a `CodeParser` instance. + +```typescript +static createInstance(): Promise +``` + +### Return Value + +A promise resolving to the created `CodeParser` object. + +### Code Snippet + +```js +let reader = await Dynamsoft.DCP.CodeParser.createInstance(); +``` + +## destroyContext + +Destroys the `CodeParser` instance in WASM. If your page needs to create new instances from time to time, don't forget to destroy unused old instances. + +```typescript +destroyContext(): void +``` + +### Code Snippet + +```js +let parser = await Dynamsoft.DCP.CodeParser.createInstance(); +// ... parse ... +parser.destroyContext(); +``` + +## setCodeFormat + +Sets the code format that needs parsing. See EnumCodeFormat to check if it has the code format you are looking for. + +```typescript +setCodeFormat(format: EnumCodeFormat): Promise +``` + +### Parameters + +`format`: specifies the code's format represented by EnumCodeFormat. + +### Return Value + +A promise that resolves when the operation succeeds. + +### Code Snippet + +```js +await parser.setCodeFormat(Dynamsoft.DCP.EnumCodeFormat.CF_AUTO); +// ... parse ... +``` + +## parseData + +Parses the code into readable info. + +```typescript +parseData(source: number[] | Uint8Array | string): Promise +``` + +### Parameters + +`source`: specifies the code data represented by a numder[], Uint8Array or string. + +### Return Value + +A promise resolving to a `ParseResult` object which contains the parsing result. + +### Code Snippet + +```js +await parser.parseData(YOUR-CODE-THAT-NEEDS-PARSING); +``` + +### See Also + +* [Uint8Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array) +* [ParseResult](./interface/ParseResult.md) + + \ No newline at end of file diff --git a/development/javascript/api-reference/InitializeEngine.md b/development/javascript/api-reference/InitializeEngine.md new file mode 100644 index 0000000..5cb6b6a --- /dev/null +++ b/development/javascript/api-reference/InitializeEngine.md @@ -0,0 +1,48 @@ +--- +layout: default-layout +title: Initialize Engine - Dynamsoft Code Parser JavaScript API +description: This page shows the APIs used to initialize engine in Dynamsoft Code Parser JavaScript SDK. +keywords: Initialize Engine, api reference, javascript, js +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +breadcrumbText: Initialize Engine +--- + +# Initialization + +* engineResourcePath +* loadWasm() + +## engineResourcePath + +Specifies the path to find the engine(s). The property needs to be set before [loadWasm](#loadwasm). If not specified, the library will try to find the engine in the same location as the main JavaScript file (dcp.js). + +```typescript +static engineResourcePath: string +``` + +**Code Snippet** + +```js +Dynamsoft.DCP.CodeParser.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@1.1.0/dist/"; +await Dynamsoft.DCP.CodeParser.loadWasm(); +``` + +## loadWasm + +Downloads and compiles the engine to get it loaded/ready for a CodeParser instance to be created. You can call this API to silently set the operating environment of the library as soon as the page is loaded, avoiding unnecessary waiting time when using the library later. + +If this API is not called beforehand, it will be called automatically when creating an instance of CodeParser. + +```typescript +static loadWasm(): Promise +``` + +**Code Snippet** + +```js +window.addEventListener('DOMContentLoaded', (event) => { + Dynamsoft.DCP.CodeParser.loadWasm(); +}); +``` diff --git a/development/javascript/api-reference/InterfacesEnums.md b/development/javascript/api-reference/InterfacesEnums.md new file mode 100644 index 0000000..90188b8 --- /dev/null +++ b/development/javascript/api-reference/InterfacesEnums.md @@ -0,0 +1,27 @@ +--- +layout: default-layout +title: Interfaces and Enums - Dynamsoft Code Parser JavaScript API +description: This page shows the interfaces and enums of Dynamsoft Code Parser JavaScript SDK. +keywords: CodeParser, api reference, javascript, js +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +breadcrumbText: CodeParser +--- + +# Interfaces and Enums + +In order to make the code more predictable and readable, the library defines a series of supporting interfaces and enumerations. + +## Interfaces + +* [CodeParserException](./interface/CodeParserException.md) +* [BasicPersonalInfo](./interface/BasicPersonalInfo.md) +* [ParseResult](./interface/ParseResult.md) + +## Enums + +* [EnumErrorCode](./enum/EnumErrorCode.md) +* [EnumCodeFormat](./enum/EnumCodeFormat.md) +* [EnumResultInfoType](./enum/EnumResultInfoType.md) + diff --git a/development/javascript/api-reference/LicenseControl.md b/development/javascript/api-reference/LicenseControl.md new file mode 100644 index 0000000..149e255 --- /dev/null +++ b/development/javascript/api-reference/LicenseControl.md @@ -0,0 +1,32 @@ +--- +layout: default-layout +title: Initialize License - Dynamsoft Code Parser JavaScript API +description: This page shows the APIs used to initialize license in Dynamsoft Code Parser JavaScript SDK. +keywords: Initialize License, api reference, javascript, js +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +breadcrumbText: Initialize License +--- + +# License Control + +* license + + +## license + +Specify an online license or an offline license. Dynamsoft usually provides an online license. + +`license` needs to be set before `createInstance()` or `loadWasm()`. + +```typescript +static license: string +``` + +**Code Snippet** + +```js +Dynamsoft.DCP.CodeParser.license = "YOUR-LICENSE-KEY"; +let parser = await Dynamsoft.DCP.CodeParser.createInstance(); +``` \ No newline at end of file diff --git a/development/javascript/api-reference/enum/EnumCodeFormat.md b/development/javascript/api-reference/enum/EnumCodeFormat.md new file mode 100644 index 0000000..8c91a36 --- /dev/null +++ b/development/javascript/api-reference/enum/EnumCodeFormat.md @@ -0,0 +1,21 @@ +--- +layout: default-layout +title: EnumCodeFormat - Dynamsoft Code Parser JavaScript Enum +description: This page shows the EnumCodeFormat enum of Dynamsoft Code Parser for JavaScript. +keywords: EnumCodeFormat, javascript, enum +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: EnumCodeFormat +--- + +# EnumCodeFormat + +```ts +enum EnumCodeFormat{ + CF_AUTO = 0, + CF_DL_SOUTH_AFRICA = 1, + CF_DL_AAMVA = 2, + CF_AADHAAR = 6 +} +``` + diff --git a/development/javascript/api-reference/enum/EnumErrorCode.md b/development/javascript/api-reference/enum/EnumErrorCode.md new file mode 100644 index 0000000..a62cba8 --- /dev/null +++ b/development/javascript/api-reference/enum/EnumErrorCode.md @@ -0,0 +1,34 @@ +--- +layout: default-layout +title: EnumErrorCode - Dynamsoft Code Parser JavaScript Enum +description: This page shows the EnumErrorCode enum of Dynamsoft Code Parser for JavaScript. +keywords: EnumErrorCode, javascript, enum +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: EnumErrorCode +--- + +# EnumErrorCode + +```ts +enum EnumErrorCode{ + DCP_OK = 0, + DCP_NULL_POINTER = -10002, + DCP_LICENSE_INVALID = -10003, + DCP_LICENSE_EXPIRED = -10004, + DCP_INVALID_DATA = -90003, + DCP_INVALID_KEY = -90004, + DCP_NOT_VALID_VDS_TYPE = -90005, + DCP_VDS_CHECK_FAILED = -90006, + DCP_VDS_INVALID_CER = -90007, + DCP_VDS_INVALID_SIGNATURE = -90008, + DCP_VDS_CANNOT_OPEN_CERTIFICATE = -90009, + DCP_LICENSE_DOMAIN_NOT_MATCH = -10043, + DCP_AADHAAR_CHECK_FAILED = -90011, + DCP_NOT_SUPPORTED_YET = -10006, + DCP_NO_LICENSE = -20000, + DCP_LICENSE_SYNC_FAILED = -20003, + DCP_TRIAL_LICENSE = -20010, + DCP_FAILED_TO_REACH_DLS = -20200 +} +``` diff --git a/development/javascript/api-reference/enum/EnumResultInfoType.md b/development/javascript/api-reference/enum/EnumResultInfoType.md new file mode 100644 index 0000000..c3cfbc5 --- /dev/null +++ b/development/javascript/api-reference/enum/EnumResultInfoType.md @@ -0,0 +1,22 @@ +--- +layout: default-layout +title: EnumResultInfoType - Dynamsoft Code Parser JavaScript Enum +description: This page shows the EnumResultInfoType enum of Dynamsoft Code Parser for JavaScript. +keywords: EnumResultInfoType, javascript, enum +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: EnumResultInfoType +--- + +# EnumResultInfoType + +```ts +enum EnumResultInfoType{ + RIT_DRIVER_LICENSE_AAMVA = 0, + RIT_PERSONAL_ID = 1, + RIT_VDSNC = 2, + RIT_AADHAAR = 3, + RIT_DRIVER_LICENSE_SOUTH_AFRICA = 4 +} +``` + diff --git a/development/javascript/api-reference/enum/index.md b/development/javascript/api-reference/enum/index.md new file mode 100644 index 0000000..3427fe8 --- /dev/null +++ b/development/javascript/api-reference/enum/index.md @@ -0,0 +1,17 @@ +--- +layout: default-layout +title: Enum Index - Dynamsoft Code Parser JavaScript API +description: This page shows the Enums of Dynamsoft Code Parser JavaScript SDK. +keywords: enums, api reference, javascript, js +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: Enum Index +--- + +# Enums + +Dynamsoft Code Parser JavaScript SDK has the following enums. + +* [EnumCodeFormat](enumcodeformat.html) +* [EnumErrorCode](enumerrorcode.html) +* [EnumResultInfoType](enumresultinfotype.html) diff --git a/development/javascript/api-reference/index.md b/development/javascript/api-reference/index.md new file mode 100644 index 0000000..558c652 --- /dev/null +++ b/development/javascript/api-reference/index.md @@ -0,0 +1,86 @@ +--- +layout: default-layout +title: Entry Page - Dynamsoft Code Parser JavaScript API +description: This is the main page of Dynamsoft Code Parser JavaScript SDK API Reference. +keywords: CodeParser, api reference, javascript, js +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +breadcrumbText: API Reference +--- + +# JavaScript API Reference + +The Dynamsoft Code Parser JavaScript library comes with one primary class: `CodeParser`. + +## CodeParser + +A CodeParser takes code data in forms of byte array or plain string as input and returns parsed results. The following code snippet shows its basic usage: + +```js +let parser = await Dynamsoft.DCP.CodeParser.createInstance(); +parser.setCodeFormat(enumcodeformat); +let result = await parser.parseData(code); +console.log(result); +``` + +The APIs for this class include: + +### Initialize License + +| API Name | Description | +|---|---| +| [license](LicenseControl.md#license) | Initializes license of DCP. | + +### Initialize Engine + +| API Name | Description | +|---|---| +| [engineResourcePath](InitializationControl.md#engineresourcepath) | Specifies the path of WASM engine. | +| [loadWasm()](InitializationControl.md#loadwasm) | Loads and compiles the WASM. | + +### Create and Destroy + +| API Name | Description | +|---|---| +| [createInstance()](CodeParser.md#createinstance) | Creates a `CodeParser` instance. | +| [destroyContext()](CodeParser.md#destroycontext) | Destroys the `CodeParser` instance in WASM. | + +### Set Code Format + +| API Name | Description | +|---|---| +| [setCodeFormat()](CodeParser.md#setcodeformat) | Sets input code's format. | + +### Parse Code Data + +| API Name | Description | +|---|---| +| [parseData()](CodeParser.md#parsedata) | Parses code data for readable results. | + + + +## Interfaces and Enums + +In order to make the code more predictable and readable, the library defines a series of supporting interfaces and enumerations: + +### Interfaces + +* [CodeParserException](../api-reference/interface/CodeParserEception.md) +* [BasicPersonalInfo](../api-reference/interface/BasicPersonalInfo.md) +* [ParseResult](../api-reference/interface/ParseResult.md) + +### Enums + +* [EnumErrorCode](../api-reference/enum/EnumErrorCode.md) +* [EnumCodeFormat](../api-reference/enum/EnumCodeFormat.md) +* [EnumResultInfoType](../api-reference/enum/EnumResultInfoType.md) diff --git a/development/javascript/api-reference/interface/BasicPersonalInfo.md b/development/javascript/api-reference/interface/BasicPersonalInfo.md new file mode 100644 index 0000000..10ab0ac --- /dev/null +++ b/development/javascript/api-reference/interface/BasicPersonalInfo.md @@ -0,0 +1,66 @@ +--- +layout: default-layout +title: BasicPersonalInfo - Dynamsoft Code Parser JavaScript Interface +description: This page shows the BasicPersonalInfo interface of Dynamsoft Code Parser for JavaScript. +keywords: BasicPersonalInfo, javascript, interface +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: BasicPersonalInfo +--- + +# BasicPersonalInfo + +`interface` BasicPersonalInfo + +* idNo: *string* + +* fullName: *string* + +* firstName: *string* + +* middleName: *string* + +* lastName: *string* + +* suffix: *string* + +* givenNameAlias: *string* + +* lastNameAlias: *string* + +* suffixAlias: *string* + +* sex: *string* + +* race: *string* + +* birthPlace: *string* + +* birthYear: *number* + +* birthMonth: *number* + +* birthDay: *number* + +* addressCity: *string* + +* addressPostalCode: *string* + +* addressStreet_1: *string* + +* addressStreet_2: *string* + +* issuingCountry: *string* + +* issuedYear: *number* + +* issuedMonth: *number* + +* issuedDay: *number* + +* expirationYear: *number* + +* expirationMonth: *number* + +* expirationDay: *number* + diff --git a/development/javascript/api-reference/interface/CodeParserException.md b/development/javascript/api-reference/interface/CodeParserException.md new file mode 100644 index 0000000..f67655f --- /dev/null +++ b/development/javascript/api-reference/interface/CodeParserException.md @@ -0,0 +1,19 @@ +--- +layout: default-layout +title: CodeParserException - Dynamsoft Code Parser JavaScript Interface +description: This page shows the CodeParserException interface of Dynamsoft Code Parser for JavaScript. +keywords: CodeParserException, javascript, interface +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: CodeParserException +--- + +# CodeParserException + +`interface` CodeParserException + +* code: *[EnumErrorCode](../enum/EnumErrorCode.md)* + + > The error code. + + diff --git a/development/javascript/api-reference/interface/ParseResult.md b/development/javascript/api-reference/interface/ParseResult.md new file mode 100644 index 0000000..003539a --- /dev/null +++ b/development/javascript/api-reference/interface/ParseResult.md @@ -0,0 +1,25 @@ +--- +layout: default-layout +title: ParseResult - Dynamsoft Code Parser JavaScript Interface +description: This page shows the ParseResult interface of Dynamsoft Code Parser for JavaScript. +keywords: ParseResult, javascript, interface +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: ParseResult +--- + +# ParseResult + +`interface` ParseResult + +* resultInfoType: *number | [EnumCodeFormat](../enum/EnumCodeFormat.md)* + + > The parsed result type. + +* basicPersonalInfo: *[BasicPersonalInfo](BasicPersonalInfo.md)* + + > The common basic personal info. + +* resultInfo: *any* + + > The parsed result apart from basicPersonalInfo. diff --git a/development/javascript/api-reference/interface/index.md b/development/javascript/api-reference/interface/index.md new file mode 100644 index 0000000..aa63589 --- /dev/null +++ b/development/javascript/api-reference/interface/index.md @@ -0,0 +1,17 @@ +--- +layout: default-layout +title: Interface Index - Dynamsoft Code Parser JavaScript API +description: This page shows the Interfaces of Dynamsoft Code Parser JavaScript SDK. +keywords: interfaces, api reference, javascript, js +needAutoGenerateSidebar: false +noTitleIndex: true +breadcrumbText: Interface Index +--- + +# Interfaces + +Dynamsoft Code Parser JavaScript SDK has the following interfaces. + +* [BasicPersonalInfo](basicpersonalinfo.html) +* [CodeParserException](codeparserexception.html) +* [ParseResult](parseresult.html) diff --git a/development/javascript/index.md b/development/javascript/index.md new file mode 100644 index 0000000..130f803 --- /dev/null +++ b/development/javascript/index.md @@ -0,0 +1,22 @@ +--- +layout: default-layout +title: Main Page - Dynamsoft Code Parser for JavaScript +description: This is the main page of Dynamsoft Code Parser for JavaScript Language. +keywords: javascript +needAutoGenerateSidebar: true +needGenerateH3Content: true +--- + +# JavaScript Documentation + +## Getting Started + +- [User Guide](user-guide.md) + +## API Reference + +- [API Reference](api-reference/index.md) + +## Release Notes + +- [Version 1.x](release-notes/js-1.md) diff --git a/development/javascript/release-notes/index.md b/development/javascript/release-notes/index.md new file mode 100644 index 0000000..18e49ff --- /dev/null +++ b/development/javascript/release-notes/index.md @@ -0,0 +1,13 @@ +--- +layout: default-layout +title: Release Notes - Dynamsoft Code Parser JavaScript SDK +description: This is the release notes page of Dynamsoft Code Parser JavaScript SDK. +keywords: release notes, javascript +needAutoGenerateSidebar: false +breadcrumbText: Release Notes +--- + +# Dynamsoft Code Parser JavaScript SDK - Release Notes + +- [1.1.0 (07/19/2022)](js-1.md/#110-07192022) +- [1.0.2 (06/08/2022)](js-1.md/#102-06082022) diff --git a/development/javascript/release-notes/js-1.md b/development/javascript/release-notes/js-1.md new file mode 100644 index 0000000..7fd1b84 --- /dev/null +++ b/development/javascript/release-notes/js-1.md @@ -0,0 +1,40 @@ +--- +layout: default-layout +title: Release Notes v1.x - Dynamsoft Code Parser JavaScript SDK +description: This is the release notes page for Dynamsoft Code Parser JavaScript SDK v1.x. +keywords: release notes, javascript +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +--- + +# Release Notes for JavaScript SDK - 1.x + +## 1.1.0 (07/18/2022) + +### Add + +* Add `CF_AADHAAR` to EnumCodeFormat. +* Add `RIT_AADHAAR` to EnumResultInfoType. +* Add some new enums to [EnumErrorCode](../api-reference/enum/EnumErrorCode.md). + +### Change + +* Change `CF_DL_AAMVA_ANSI` to `CF_DL_AAMVA`. +* Change `RIT_DRIVER_LICENSE_INFO` to `RIT_DRIVER_LICENSE_AAMVA` and `RIT_DRIVER_LICENSE_SOUTH_AFRICA`. +* Change `RIT_PERSONAL_ID_INFO` to `RIT_PERSONAL_ID`. +* Change `RIT_VDSNC_INFO` to `RIT_VDSNC`. + +## 1.0.2 (06/08/2022) + +### New + +* New property `license` to control license of DCP. +* New property `engineResourcePath` to specify the path of DCP WASM engine. +* New `loadWasm()` to `CodeParser` to load and compile the WASM. +* New method `createInstance()` to `CodeParser` to create a CodeParser instance. +* New method `destroyContext()` to `CodeParser` to destroy the CodeParser instance in WASM. +* New method `setCodeFormat()` to `CodeParser` to set what type of code you want to parse. +* New method `parseData()` to `CodeParser` to parse code. +* New method `setCryptoPyblicKey()` to `CodeParser` to set a public key if code parsing needs. +* New method `setCertificate()` to `CodeParser` to set a certificate if code parsing needs. diff --git a/development/javascript/user-guide.md b/development/javascript/user-guide.md new file mode 100644 index 0000000..35d9b4e --- /dev/null +++ b/development/javascript/user-guide.md @@ -0,0 +1,227 @@ +--- +layout: default-layout +title: User Guide - Dynamsoft Code Parser for JavaScript +description: This is the user guide page of Dynamsoft Code Parser for JavaScript SDK. +keywords: user guide, javascript +breadcrumbText: User Guide +noTitleIndex: true +needAutoGenerateSidebar: true +needGenerateH3Content: true +--- + + + +# Dynamsoft Code Parser for Your Website + +Dynamsoft Code Parser is designed to parse data strings (usually encrypted in barcodes, machine readable zones, etc.) into human-readable information. The JavaScript edition is based on WebAssembly and offers great speed and accuracy. With its well-designed API, you can equip your web pages with a code parser with just a few lines of code. + +In this guide, you will learn step by step on how to integrate the DCP-JS SDK into your website. + +Table of Contents + +* [Hello World - Simplest Implementation](#hello-world---simplest-implementation) +* [Building your own page](#building-your-own-page) + * [Include the SDK](#include-the-sdk) + * [Configure the SDK](#configure-the-sdk) + * [Interact with the SDK](#interact-with-the-sdk) +* [API Documentation](#api-documentation) + +## Hello World - Simplest Implementation + +Let's start with the "Hello World" example of the SDK which demonstrates how to use the minimum code to enable a web page to parse codes into readable info. + +The complete code of the "Hello World" example is shown below: + +> Since the code that needs parsing is usually hard to understand and often comes from images, we choose an online image which contains a US driver license to demonstrate how to parse the code with the help of `BarcodeReader` . Please make sure your device is connected to the Internet when opening the following example in your browser. + +```html + + + + + + + + + + +``` + +### About the code + +* `license`: This property specifies a license key. Read more on [Specify the license](#specify-the-license). + +* `createInstance()`: This method creates a CodeParser object. + +* `setCodeFormat`: This method sets the code's format before parsing. + +* `parseData`: This method parses the code. + +For the rest of the code, please read more about [DBR-JS User Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/). + +## Building your own page + +### Include the SDK + +#### Use a CDN + +The simplest way to include the SDK is to use either the [jsDelivr](https://jsdelivr.com/) or [UNPKG](https://unpkg.com/) CDN. The "hello world" example above uses **jsDelivr**. + +* jsDelivr + + ```html + + ``` + +* UNPKG + + ```html + + ``` + +#### Host the SDK yourself + +Besides using the CDN, you can also download the SDK and host its files on your own website / server before including it in your application. + +Options to download the SDK: + +* yarn + + ```cmd + yarn add dynamsoft-code-parser + ``` + +* npm + + ```cmd + npm install dynamsoft-code-parser --save + ``` + +Depending on how you downloaded the SDK and where you put it, you can typically include it like this: + +```html + +``` + +or + +```html + +``` + +### Configure the SDK + +Before using the SDK, you need to configure a few things. + +#### Specify the license + +The SDK requires a license to work, use the API `license` to specify the license key. + +```javascript +//You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dcp&package=js to get your own trial license good for 30 days. +Dynamsoft.DCP.CodeParser.license = "YOUR-LICENSE-KEY"; +``` + +#### Specify the location of the "engine" files + +This is usually only required with frameworks like Angular or React, etc. where dcp.js is compiled into another file. + +The purpose is to tell the SDK where to find the engine files (\*.worker.js, \*.wasm.js and \*.wasm, etc.). The API is called `engineResourcePath` : + +```javascript +//The following code uses the jsDelivr CDN, feel free to change it to your own location of these files +Dynamsoft.DCP.CodeParser.engineResourcePath = "https://cdn.jsdelivr.net/npm/dynamsoft-code-parser@1.1.0/dist/"; +``` + +### Interact with the SDK + +#### Create a `CodeParser` object + +To use the SDK, we first create a CodeParser object. + +```javascript +Dynamsoft.DCP.CodeParser.license = "YOUR-LICENSE-KEY"; +let parser = null; +try { + parser = await Dynamsoft.DCP.CodeParser.createInstance(); +} catch (ex) { + console.error(ex); +} +``` + +Tip: When creating a CodeParser object within a function which may be called more than once, it's best to use a "helper" variable to avoid double creation such as pParser in the following code + +```javascript +Dynamsoft.DCP.CodeParser.license = "YOUR-LICENSE-KEY"; +let pParser = null; + +function foo() { + try { + const parser = await (pParser = pParser || Dynamsoft.DCP.CodeParser.createInstance()); + } catch (ex) { + console.error(ex); + } +} +``` + +#### Set code format + +Before parsing, you need to specify the format of code to parse. See [EnumCodeFormat](https://www.dynamsoft.com/code-parser/docs/development/javascript/api-reference/enum/EnumCodeFormat.html?ver=1.0.2) to check if DCP-JS covers the code format you need. + +```javascript +parser.setCodeFormat(format); //format: EnumCodeFormat +``` + +#### Parse code + +The method `parseData()` takes data in three formats: `number[]`, `Uint8Array` and `string`. If you want to parse a barcode into readable info, you should first extract the information from the barcode using DBR-JS before parsing it with DCP-JS. + +> For more information on using DBR-JS, read [DBR-JS User Guide](https://www.dynamsoft.com/barcode-reader/programming/javascript/user-guide/). + +```javascript +parser.parseData(data); //data: number[] | Uint8Array | string +``` + + + +## API Documentation + +For more information about the APIs of DCP-JS, read [Dynamsoft Code Parser JavaScript Edition API Reference](https://www.dynamsoft.com/code-parser/docs/development/javascript/api-reference/?ver=1.1.0). diff --git a/faq.md b/faq.md new file mode 100644 index 0000000..0109fe8 --- /dev/null +++ b/faq.md @@ -0,0 +1,8 @@ +--- +layout: default-layout +title: Dynamsoft Code Parser - FAQ +description: This is the FAQ page of Dynamsoft Code Parser. +keywords: faq +needAutoGenerateSidebar: true +--- + diff --git a/index.md b/index.md new file mode 100644 index 0000000..e610922 --- /dev/null +++ b/index.md @@ -0,0 +1,17 @@ +--- +layout: home-page +title: Dynamsoft Code Parser SDK Documentation +keywords: Dynamsoft Code Parser, dlr, documentation +description: Dynamsoft Code Parser SDK Documentation Homepage +--- + +# Dynamsoft Code Parser Documentation + +* [Introduction]({{site.introduction}}) + +* Development + * [JavaScript]({{site.javascript}}) + * [C++]({{site.cpp}}) + +* Useful resources + * [Release Notes]({{site.release-notes}}) diff --git a/introduction/index.md b/introduction/index.md new file mode 100644 index 0000000..1c5fbcb --- /dev/null +++ b/introduction/index.md @@ -0,0 +1,70 @@ +--- +layout: default-layout +title: Introduction - Dynamsoft Code Parser SDK +description: This is the main page of Dynamsoft Code Parser Introduction. +needAutoGenerateSidebar: true +needGenerateH3Content: true +noTitleIndex: true +--- + +# Introduction to Dynamsoft Code Parser + +When working with IDs, driver licenses, or sometimes even general barcodes, you may encounter results (usually as a plain string) that are "unreadable" but contain all the useful information you need. Dynamsoft Code Parser (DCP) is an SDK designed for parsing these types of results into human-readable information. + +For the initial release, DCP is only available for web applications as "DCP JavaScript Edition". Based on JavaScript and WebAssembly, DCP JavaScript Edition can run in all major modern browsers on all major platforms. + +## Usage Scenarios + +* AAMVA driver's license + +Countries covered: USA, Canada. + +All versions of the AAMVA Driver's License/Identification Specification used in the US and Canada are supported. The PDF417 barcodes on driver licenses with magnetic stripes, which follow the AAMVA Magnetic Stripe standard, are capable to get parsed. + +* South African driver's license + +The fields parsed from the South African driver's license are currently limited to some personal information, while the full information will be parsed in a future release. + +* Aadhaar Card in India + +The normal QR codes or Secure QR codes on eAadhaar, Aadhaar Letter and Aadhaar PVC Card are all capable to be parsed. + +* Coming soon + +Future releases will support more scenarios such as international COVID-19 vaccination certificates, machine readable zones and ID parsing. + +## Supported Platforms + +| Platforms | Languages | +|-----------|---------------------------| +| web Web | JavaScript | + +> Future versions will support more platforms, such as Android/Mobile, etc. + +## How to use + +There are mainly four steps to use a CodeParser, the following takes the JavaScript edtion for example: + +1. Initialize license + + Before you begin, you must set up a license that allows you to use DCP. You can visit https://www.dynamsoft.com/customer/license/trialLicense?utm_source=github&product=dcp&package=js to get your own trial license good for 30 days. + +2. Create Code Parser instance + + With a license in place, you can create a Code Parser instance to use. For the JavaScript edition, the SDK is designed to download and compile the WASM resources (the engine files) automaticly before creating an instance. + +3. Set code format + + The 2nd last step is to set the code format (see [EnumCodeFormat](../development/javascript/api-reference/enum/EnumCodeFormat.md)) of the document image that you want to get information from. + +4. Parse code + + Lastly, call the method `parseData()` to do the actual parsing and get results in a specific format (see [EnumResultInfoType](../development/javascript/api-reference/enum/EnumResultInfoType.md)). + + + +## Next Step + +Learn how to use DCP to add code parsing capabilities to your web application: + +* [JavaScript (Web)]({{site.javascript}}) diff --git a/release-notes/index.md b/release-notes/index.md new file mode 100644 index 0000000..afbeedf --- /dev/null +++ b/release-notes/index.md @@ -0,0 +1,62 @@ +--- +layout: default-layout +title: Release Notes - Dynamsoft Code Parser SDK +description: This is the release notes page of Dynamsoft Label Recoginizer SDK. +keywords: release notes +needAutoGenerateSidebar: true +needGenerateH3Content: false +noTitleIndex: true +breadcrumbText: Release Note +--- + +# Release Notes + +## 2.0.0 + + > First released: 04-30-2023 + +### Highlights + +[TODO] + +| Versions | Available Editions | +|---|---| +| 2.0.0 | [C++]({{ site.cpp_release_notes}}cpp-2.html#200-04302023) | + +## 1.1.0 + + > First released: 07-18-2022 + +### Highlights + +Dynamsoft Code Parser 1.1.0 version supports parsing two new types: + +* Driver license with magnetic stripes + + The PDF417 barcodes on driver licenses with magnetic stripes, which follow the AAMVA Magnetic Stripe standard, are capable to get parsed. Such as a combined BC Driver's License and Services Card (with a Magnetic Stripe on it). + +* Aadhaar Card in India + + The normal QR codes or Secure QR codes on eAadhaar, Aadhaar Letter and Aadhaar PVC Card are all capable to be parsed. + +| Versions | Available Editions | +|---|---| +| 1.1.0 | [JavaScript](../development/javascript/release-notes/js-1.md) | + +## 1.0.2 + + > First released: 06-08-2022 + +### Highlights + +Dynamsoft Code Parser 1.0.2 version supports parsing code from driver license and COVID-19 vaccination certificate. + +* Driver license + + Cover countries: USA, Canada, South Africa. + + All versions of the AAMVA Driver License/Identification specification used in the USA and in Canada supported. Fields parsed from South Africa driver licenses are currently limited to some personal information. + +| Versions | Available Editions | +|---|---| +| 1.0.2 | [JavaScript](../development/javascript/release-notes/js-1.md) | diff --git a/search.md b/search.md new file mode 100644 index 0000000..95c3fe3 --- /dev/null +++ b/search.md @@ -0,0 +1,5 @@ +--- +layout: search-page +title: Dynamsoft Code Parser SDK Documentation Search +keywords: Dynamsoft Code Parser SDK Documentation Search +--- \ No newline at end of file From c5b93e37dfb2dc15a2914b497ab95b1af10a21f1 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher <65145280+DMGithubPublisher@users.noreply.github.com> Date: Mon, 17 Apr 2023 15:25:12 +0800 Subject: [PATCH 2/7] Update _config.yml --- _config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_config.yml b/_config.yml index 4b36e0c..d6b73ae 100644 --- a/_config.yml +++ b/_config.yml @@ -1,5 +1,5 @@ repositoryUrl: https://github.com/dynamsoft-docs/code-parser-docs/blob/main -repository: Dynamsoft/code-parser-docs +repository: dynamsoft-docs/code-parser-docs docFullPath: https://www.dynamsoft.com/code-parser/docs firstLevelUrl: /code-parser/docs/ docHomePage: /code-parser/docs/introduction/ From fde5ec613235b72a459ca0fb0fcb51ca996343ab Mon Sep 17 00:00:00 2001 From: DMGithubPublisher <65145280+DMGithubPublisher@users.noreply.github.com> Date: Mon, 17 Apr 2023 16:03:40 +0800 Subject: [PATCH 3/7] Update main.yml --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6256f13..d0b7c66 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -5,8 +5,8 @@ name: CI # Controls when the workflow will run on: # Triggers the workflow on push events but only for the main branch - push: - branches: + push: + branches: # - main - preview From ac93f734306918da0b7a9e49f857d838f993aa7a Mon Sep 17 00:00:00 2001 From: Tom Kent Date: Sun, 25 Jun 2023 18:36:11 -0700 Subject: [PATCH 4/7] change JS upload dir --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d0b7c66..71dc4d0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -53,7 +53,7 @@ jobs: password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }} port: 21 local-dir: /home/ubuntu/DDNDocServer/_site/ - server-dir: /www.dynamsoft.com/code-parser/docs/js/ + server-dir: /www.dynamsoft.com/code-parser/docs/web/ Build-Preview: if: ${{ github.ref == 'refs/heads/preview' }} @@ -91,4 +91,4 @@ jobs: password: ${{ secrets.FTP_TEST_SITE_PASSWORD }} port: 7500 local-dir: /home/ubuntu/DCPDocJSPreview/_site/ - server-dir: /www.dynamsoft.com/code-parser/docs/js/ + server-dir: /www.dynamsoft.com/code-parser/docs/web/ From 8623a10b94a25b3f124d47121647c00c2f78bce8 Mon Sep 17 00:00:00 2001 From: DMGithubPublisher Date: Tue, 4 Jul 2023 09:51:13 +0800 Subject: [PATCH 5/7] fix site build --- .github/workflows/main.yml | 4 +- _config.yml | 71 ++++---- _data/full_tree.yml | 6 +- _includes/dcpNav.html | 2 +- _includes/sidelist-code-types.html | 9 - _includes/sidelist-development.html | 62 ------- _includes/sidelist-full-tree.html | 5 +- _includes/sidelist-introduction.html | 3 - .../sidelist-programming-javascript.html.html | 30 +++ _includes/sidelist-release-notes.html | 2 - _includes/sidelist-useful.html | 3 - code-types/aadhaar.md | 15 -- code-types/aamva-dl-id.md | 15 -- code-types/index.md | 17 -- code-types/mrtd.md | 15 -- code-types/sa-dl.md | 15 -- code-types/vin.md | 17 -- .../api-reference/class/code-parser.md | 172 ------------------ .../cplusplus/api-reference/class/index.md | 13 -- .../api-reference/class/license-manager.md | 122 ------------- .../api-reference/class/parsed-result-item.md | 82 --------- .../api-reference/enum/error-code.md | 55 ------ .../cplusplus/api-reference/enum/index.md | 13 -- .../api-reference/enum/mapping-status.md | 31 ---- .../api-reference/enum/validation-status.md | 31 ---- development/cplusplus/api-reference/index.md | 22 --- development/cplusplus/index.md | 22 --- development/cplusplus/release-notes/cpp-2.md | 15 -- development/cplusplus/release-notes/index.md | 11 -- development/cplusplus/user-guide.md | 169 ----------------- faq.md | 8 - index.md | 17 -- introduction/index.md | 70 ------- .../javascript/api-reference/CodeParser.md | 0 .../api-reference/InitializeEngine.md | 0 .../api-reference/InterfacesEnums.md | 0 .../api-reference/LicenseControl.md | 0 .../api-reference/enum/EnumCodeFormat.md | 0 .../api-reference/enum/EnumErrorCode.md | 0 .../api-reference/enum/EnumResultInfoType.md | 0 .../javascript/api-reference/enum/index.md | 0 .../javascript/api-reference/index.md | 0 .../interface/BasicPersonalInfo.md | 0 .../interface/CodeParserException.md | 0 .../api-reference/interface/ParseResult.md | 0 .../api-reference/interface/index.md | 0 .../javascript/index.md | 0 .../javascript/release-notes/index.md | 0 .../javascript/release-notes/js-1.md | 0 .../javascript/user-guide.md | 4 +- release-notes/index.md | 62 ------- 51 files changed, 74 insertions(+), 1136 deletions(-) delete mode 100644 _includes/sidelist-code-types.html delete mode 100644 _includes/sidelist-development.html delete mode 100644 _includes/sidelist-introduction.html create mode 100644 _includes/sidelist-programming-javascript.html.html delete mode 100644 _includes/sidelist-release-notes.html delete mode 100644 _includes/sidelist-useful.html delete mode 100644 code-types/aadhaar.md delete mode 100644 code-types/aamva-dl-id.md delete mode 100644 code-types/index.md delete mode 100644 code-types/mrtd.md delete mode 100644 code-types/sa-dl.md delete mode 100644 code-types/vin.md delete mode 100644 development/cplusplus/api-reference/class/code-parser.md delete mode 100644 development/cplusplus/api-reference/class/index.md delete mode 100644 development/cplusplus/api-reference/class/license-manager.md delete mode 100644 development/cplusplus/api-reference/class/parsed-result-item.md delete mode 100644 development/cplusplus/api-reference/enum/error-code.md delete mode 100644 development/cplusplus/api-reference/enum/index.md delete mode 100644 development/cplusplus/api-reference/enum/mapping-status.md delete mode 100644 development/cplusplus/api-reference/enum/validation-status.md delete mode 100644 development/cplusplus/api-reference/index.md delete mode 100644 development/cplusplus/index.md delete mode 100644 development/cplusplus/release-notes/cpp-2.md delete mode 100644 development/cplusplus/release-notes/index.md delete mode 100644 development/cplusplus/user-guide.md delete mode 100644 faq.md delete mode 100644 index.md delete mode 100644 introduction/index.md rename {development => programming}/javascript/api-reference/CodeParser.md (100%) rename {development => programming}/javascript/api-reference/InitializeEngine.md (100%) rename {development => programming}/javascript/api-reference/InterfacesEnums.md (100%) rename {development => programming}/javascript/api-reference/LicenseControl.md (100%) rename {development => programming}/javascript/api-reference/enum/EnumCodeFormat.md (100%) rename {development => programming}/javascript/api-reference/enum/EnumErrorCode.md (100%) rename {development => programming}/javascript/api-reference/enum/EnumResultInfoType.md (100%) rename {development => programming}/javascript/api-reference/enum/index.md (100%) rename {development => programming}/javascript/api-reference/index.md (100%) rename {development => programming}/javascript/api-reference/interface/BasicPersonalInfo.md (100%) rename {development => programming}/javascript/api-reference/interface/CodeParserException.md (100%) rename {development => programming}/javascript/api-reference/interface/ParseResult.md (100%) rename {development => programming}/javascript/api-reference/interface/index.md (100%) rename {development => programming}/javascript/index.md (100%) rename {development => programming}/javascript/release-notes/index.md (100%) rename {development => programming}/javascript/release-notes/js-1.md (100%) rename {development => programming}/javascript/user-guide.md (97%) delete mode 100644 release-notes/index.md diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 71dc4d0..1d78615 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,7 +7,7 @@ on: # Triggers the workflow on push events but only for the main branch push: branches: - # - main + - main - preview # Allows you to run this workflow manually from the Actions tab @@ -52,7 +52,7 @@ jobs: username: ${{ secrets.FTP_DYNAMSOFT_LOCAL_USER }} password: ${{ secrets.FTP_DYNAMSOFT_LOCAL_PASSWORD }} port: 21 - local-dir: /home/ubuntu/DDNDocServer/_site/ + local-dir: /home/ubuntu/DCPDocJS/_site/ server-dir: /www.dynamsoft.com/code-parser/docs/web/ Build-Preview: diff --git a/_config.yml b/_config.yml index d6b73ae..d3fd4ed 100644 --- a/_config.yml +++ b/_config.yml @@ -1,45 +1,48 @@ -repositoryUrl: https://github.com/dynamsoft-docs/code-parser-docs/blob/main -repository: dynamsoft-docs/code-parser-docs -docFullPath: https://www.dynamsoft.com/code-parser/docs -firstLevelUrl: /code-parser/docs/ -docHomePage: /code-parser/docs/introduction/ - -introduction: /code-parser/docs/introduction/ -parameters: /code-parser/docs/parameters/ -enumerations: /code-parser/docs/parameters/enum/ -parameters-reference: /code-parser/docs/parameters/reference/ - -development: /code-parser/docs/development/ - -cpp: /code-parser/docs/development/cplusplus/ -cpp_api: /code-parser/docs/development/cplusplus/api-reference/ -cpp_class: /code-parser/docs/development/cplusplus/api-reference/class/ -cpp_enum: /code-parser/docs/development/cplusplus/api-reference/enum/ -cpp_release_notes: /code-parser/docs/development/cplusplus/release-notes/ - - -javascript: /code-parser/docs/development/javascript/ -javascript-api: /code-parser/docs/development/javascript/api-reference/ -javascript-api-enum: /code-parser/docs/development/javascript/api-reference/enum/ -javascript-api-interface: /code-parser/docs/development/javascript/api-reference/interface/ -javascript-release-notes: /code-parser/docs/development/javascript/release-notes/ +repositoryUrl: https://github.com/dynamsoft-docs/code-parser-docs-js/blob/main +repository: dynamsoft-docs/code-parser-docs-js +docFullPath: https://www.dynamsoft.com/code-parser/docs/web +firstLevelUrl: /code-parser/docs/web/ +docHomePage: /code-parser/docs/core/introduction/ + +javascript: /code-parser/docs/web/programming/javascript/ +javascript-api: /code-parser/docs/web/programming/javascript/api-reference/ +javascript-api-enum: /code-parser/docs/web/programming/javascript/api-reference/enum/ +javascript-api-interface: /code-parser/docs/web/programming/javascript/api-reference/interface/ +javascript-release-notes: /code-parser/docs/web/programming/javascript/release-notes/ assets: /code-parser/docs/assets/ -edit_icon: /code-parser/docs/assets/img-icon/edit-icon.png -smile_icon: /code-parser/docs/assets/img-icon/icon-smile.png -sad_icon: /code-parser/docs/assets/img-icon/icon-sad.png -dbr_icon: /code-parser/docs/assets/img-icon/icon-dbr.svg -dwt_icon: /code-parser/docs/assets/img-icon/icon-dwt.svg -dnt_icon: /code-parser/docs/assets/img-icon/icon-dnt.svg +edit_icon: /code-parser/docs/web/assets/img-icon/edit-icon.png +smile_icon: /code-parser/docs/web/assets/img-icon/icon-smile.png +sad_icon: /code-parser/docs/web/assets/img-icon/icon-sad.png +dbr_icon: /code-parser/docs/web/assets/img-icon/icon-dbr.svg +dwt_icon: /code-parser/docs/web/assets/img-icon/icon-dwt.svg +dnt_icon: /code-parser/docs/web/assets/img-icon/icon-dnt.svg -release-notes: /code-parser/docs/release-notes/ -code_types: /code-parser/docs/code-types/ +release-notes: /code-parser/docs/core/release-notes/ useVersionTree: true -baseurl: "/code-parser/docs" +baseurl: "/code-parser/docs/web" plugins: - jemoji +defaults: + - scope: + path: "" + values: + layout: "default-layout" + noTitleIndex: true + needAutoGenerateSidebar: true + needGenerateH3Content: true + - scope: + path: "programming/javascript" + values: + docRootName: "Code Parser JS Edition" + docHomePage: "/code-parser/docs/web/programming/javascript/" + - scope: + path: "Hide_Tree_Page.html" + values: + sitemap: false + url: "https://www.dynamsoft.com" # sitemap root diff --git a/_data/full_tree.yml b/_data/full_tree.yml index 8f2e396..391bdaf 100644 --- a/_data/full_tree.yml +++ b/_data/full_tree.yml @@ -1,7 +1,3 @@ tree_file_list: - sidelist-full-tree.html - - sidelist-code-types.html - - sidelist-development.html - - sidelist-introduction.html - - sidelist-release-notes.html - - sidelist-useful.html + - sidelist-programming-javascript.html diff --git a/_includes/dcpNav.html b/_includes/dcpNav.html index 889d6ca..f9f9789 100644 --- a/_includes/dcpNav.html +++ b/_includes/dcpNav.html @@ -40,7 +40,7 @@