Skip to content
DemoFAQ

PDF Generation Template Editor

Open-source visual PDF generation engine with customizable templates and developer-friendly APIs.

View on GitHub

Apply the License Key — C++ ​

Copy the License Key ​

Accurately obtaining the license key is crucial for applying the license.

  1. In the email you received, locate the XML file containing the license key.
  2. Open the XML file, and determine the license type based on the <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.
  3. Copy the value located at the LICENSE_KEY position within the <key>LICENSE_KEY</key> field. This is your license key.

Apply the License Key ​

In a C++ application, call LibraryManager::LicenseVerify and check its result before initializing the SDK resources.

cpp
#include "compdf_conversion.h"

using namespace compdf;
using namespace compdf::base;
using namespace compdf::common;
using namespace compdf::conversion;

const char* license = "LICENSE_KEY";
ErrorCode code = LibraryManager::LicenseVerify(license, "DEVICE_ID", "APP_ID");
if (code == ErrorCode::Success) {
    LibraryManager::Initialize("ComPDF_Conversion_SDK/resource");
}

Use the device ID and application ID associated with your license. See C++ requirements and initializing library resources.