PDF Generation Template Editor
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.
Accurately obtaining the license key is crucial for applying the license.
<type> field. If <type>online</type> is present, it indicates an online license. If <type>offline</type> is present or if the field is absent, it indicates an offline license.LICENSE_KEY position within the <key>LICENSE_KEY</key> field. This is your license key.Use sdk.licenseVerify() before initializing the SDK and starting conversions.
const sdk = require("./lib/index.js");
const license = "LICENSE_KEY";
const deviceId = "DEVICE_ID";
const appId = "com.example.application";
const code = sdk.licenseVerify(license, deviceId, appId);
if (code !== 0) {
throw new Error(`license verification failed: ${code}`);
}
sdk.initialize();You can also read license information from environment variables in command-line tools:
const license = process.env.COMPDFKIT_LICENSE;
const deviceId = process.env.COMPDFKIT_DEVICE_ID || "";
const appId = process.env.COMPDFKIT_APP_ID || "com.example.application";The sample scripts also accept --license, --device-id, and --app-id. When these options are not provided, they read the same environment variables and fall back to local demo values packaged in the samples.