StaticverboseEnables detailed console logging during WASM discovery and initialization. Use this to debug loading issues or verify fallback behavior.
Default: false
Example:
DsPdfConfig.verbose = true;
Enables detailed console logging during WASM discovery and initialization. Use this to debug loading issues or verify fallback behavior.
Default: false
Example:
DsPdfConfig.verbose = true;
StaticwasmCustom factory for creating and initializing the DsPdf WASM module.
If defined, this function overrides the default initialization process.
Must return a Promise resolving to a fully initialized MainModule.
Useful for:
Example:
DsPdfConfig.wasmFactory = async () => {
const wasmBinary = await (await fetch("https://cdn.example.com/DsPdf.wasm")).arrayBuffer();
return createDsPdfModule({ wasmBinary });
};
Custom factory for creating and initializing the DsPdf WASM module.
If defined, this function overrides the default initialization process.
Must return a Promise resolving to a fully initialized MainModule.
Useful for:
Example:
DsPdfConfig.wasmFactory = async () => {
const wasmBinary = await (await fetch("https://cdn.example.com/DsPdf.wasm")).arrayBuffer();
return createDsPdfModule({ wasmBinary });
};
StaticwasmThe URL specifying where to load the DsPdf WebAssembly binary from.
Example:
DsPdfConfig.wasmUrl = "https://cdn.example.com/v2.0/DsPdf.wasm";
The URL specifying where to load the DsPdf WebAssembly binary from.
Example:
DsPdfConfig.wasmUrl = "https://cdn.example.com/v2.0/DsPdf.wasm";
StaticsetSets or validates the license key. The required key depends on the runtime environment.
Behavior:
key is provided, validates and applies it. Any preloaded key (from DSPDF_CONFIG) is cleared.key is omitted, validates the preloaded key.undefined is passed, removes any previously set license key and ignores the preloaded one.You can optionally preconfigure the license key before the library loads:
// Pre-load configuration (before initializing DsPdf)
globalThis.DSPDF_CONFIG = {
wasmUrl: "/assets/DsPdf.wasm",
licenseKey: "YOUR_LICENSE_KEY"
};
Examples:
await setLicenseKey(key); // validates and applies the provided license key
await setLicenseKey(undefined); // removes any previously set license key
await setLicenseKey(); // validates the preloaded license key
Optionalkey: stringLicense key to validate and apply.
Global configuration for DsPdfJS WebAssembly initialization.
DsPdfJS supports two configuration mechanisms:
Preload configuration via the global
DSPDF_CONFIGobject. This is useful when configuration must be applied before the library is imported.Runtime configuration via static properties of
DsPdfConfigafter the library has been loaded.The preload configuration is read lazily on first access and is not re-evaluated afterwards.
Example: