Skip to content

Apply the license Key

If you haven't get a license key, please check out how to obtain a license key.

ComPDFKit PDF SDK currently supports two authentication methods to verify license keys: online authentication and offline authentication.

Learn about:

What is the authentication mechanism of ComPDFKit's license?

What are the differences between Online Authentication and Offline Authentication?

Copying the License Key

Accurately obtaining the license key is crucial for the application of the license.

  1. In the email you received, locate the XML file containing the license key.

  2. Copy the XML file to the assets directory or a device storage directory.

2-3-1

Apply the License Key

Initialize the ComPDFKit SDK and authenticate using the following method. The SDK will automatically distinguish between online and offline activation:

java
String xmlPath = "assets://Android.xml";
// You can also pass the file path of the XML to initialize the SDK
// String xmlPath = "/data/user/0/your_package/files/license/Android.xml";
CPDFSdk.initWithPath(this, xmlPath, (verifyCode, verifyMsg) -> {
  Log.e("ComPDFKit", "verifyCode: " + verifyCode + ", verifyMsg: " + verifyMsg);
});