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.
If you don't have a license key, please check out how to obtain a license key.
ComPDF Conversion SDK currently supports offline authentication to verify license keys.
Learn about:
What is the authentication mechanism of ComPDF's license?
Accurately obtaining the license key is crucial for the application of 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.Online License:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<license version="1">
<platform>windows</platform>
<starttime>xxxxxxxx</starttime>
<endtime>xxxxxxxx</endtime>
<type>online</type>
<key>LICENSE_KEY</key>
</license>Offline License:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<license version="1">
<platform>windows</platform>
<starttime>xxxxxxxx</starttime>
<endtime>xxxxxxxx</endtime>
<key>LICENSE_KEY</key>
</license>license.xml in the package root. The PHP samples pass this XML file path directly to LibraryManager::licenseVerify(); you do not need to copy the <key> value out of the XML manually.You can perform offline authentication using the following method:
<?php
// Load the sample autoloader.
require __DIR__ . '/autoload.php';
use ComPDFKit\Conversion\LibraryManager;
use ComPDFKit\Conversion\ErrorCode;
// Verify the license. The Linux sample package ships license.xml in the
// package root, and accepts the XML path directly.
$resourcePath = dirname(__DIR__);
$license = $resourcePath . '/license.xml';
$deviceId = '';
$appId = '';
$code = LibraryManager::licenseVerify($license, $deviceId, $appId);
if (!ErrorCode::isSuccess($code)) {
throw new RuntimeException('License verify failed: ' . ErrorCode::describe($code));
}
// Initialize conversion resources.
LibraryManager::initialize($resourcePath);