Skip to content
ComPDF
DemoFAQ
New Release

Open-Source PDF SDK & AI Document Processing

Get the full self-hosted SDK and AI document processing on GitHub. One-click deploy to quickly build your document workflows.

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.

Online License:

xml
<?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
<?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>
  1. 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

You can perform offline authentication using the following method:

c
#include "compdf_common_c.h"

const char* license = "LICENSE_KEY";
CSDKErrorCode code = CPDF_LicenseVerify(license, "device_id", "app_id");
if (code != e_CErrSuccess) {
    return code;
}

Before calling any conversion API, initialize the SDK resource directory:

c
#include "compdf_common_c.h"

#if defined(_WIN32)
#define CPDF_TEXT(text) L##text
#else
#define CPDF_TEXT(text) text
#endif

CPDF_Initialize(CPDF_TEXT("ComPDF_Conversion_SDK/resource"));