CodeParserModule Class
The CodeParserModule
class is defined in the namespace Dynamsoft.DCP
.
API Name | Description |
---|---|
static getVersion() |
Returns the version of the CodeParser module. |
static loadSpec() |
Loads the specification for a certain type of code strings. |
getVersion
Returns the version of the CodeParser
module.
static getVersion(): string;
Code snippet
const version = Dynamsoft.DCP.CodeParserModule.getVersion();
console.log(version);
loadSpec
Loads the specification for a certain type of code strings.
loadSpec(specificationName: string | Array<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 inDynamsoft.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 callingDynamsoft.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
await Dynamsoft.DCP.CodeParserModule.loadSpec("AADHAAR");