Notice: This documentation is archived. For the latest product features and documentation, please visit Dynamsoft Capture Vision Documentation.
Initialization
- engineResourcePath
- loadWasm()
engineResourcePath
Specifies the path to find the engine(s). The property needs to be set before loadWasm. If not specified, the library will try to find the engine in the same location as the main JavaScript file (dcp.js).
static engineResourcePath: string
Code Snippet
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.
static loadWasm(): Promise<void>
Code Snippet
window.addEventListener('DOMContentLoaded', (event) => {
Dynamsoft.DCP.CodeParser.loadWasm();
});