Skip to content
Guides

Apply the License Key

ComPDFKit PDF SDK is a commercial SDK, which requires a license to grant developer permission to release their apps. ComPDFKit for Web supports flexible licensing options, please contact our sales team to know more. Each license is only valid for a root domain name and any of its subdomains. However, any documents, sample code, or source code distribution from the released package of ComPDFKit PDF SDK to any third party is prohibited.

ComPDFKit PDF SDK currently supports two types of verification methods: Online License and Offline License.

Online License: Online licensing supports dynamically updating license information. If we provide you with new services, you can obtain updates in real-time without any modifications.

Offline License: Offline licensing is suitable for scenarios with high security requirements and restricted network access. It allows you to use ComPDFKit PDF SDK when unable to connect to the internet.

Obtaining the License Key

If you want to use the ComPDFKit license for your application, we offer two types of licenses: trial license and full license.

  1. Initiate contact with our sales team by completing the requirements form on the Contact Sales page of the ComPDFKit official website.
  2. After receiving your submission, our sales team will reach out to you within 24 hours to clarify your requirements.
  3. Upon confirmation of your requirements, you will be issued a complimentary trial license valid for 30 days. Throughout this period, any issues you encounter will be supported with free technical assistance.
  4. If you are satisfied with the product, you have the option to purchase the formal license. Once the transaction is completed, our sales team will send the official license to you via email.

Copying the License Key

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

In the email you received, locate the license key. If it is an XML file, it is an offline license; otherwise, it is an online license.

Offline License:

xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<license version="1">
    <platform>web</platform>
    <starttime>xxxxxxxx</starttime>
    <endtime>xxxxxxxx</endtime>
    <key>LICENSE_KEY</key>
</license>

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 fill in the license with the key in the init function to apply the license key:

javascript
// Import the JS file of ComPDFKit Web Demo.
import ComPDFKitViewer from "/@compdfkit/webviewer";

const viewer = document.getElementById('webviewer');
ComPDFKitViewer.init({
  pdfUrl: 'Your PDF Url',
  license: '<Input your license here>'
}, viewer)
.then((core) => {
  const docViewer = core.docViewer;
  docViewer.addEvent('documentloaded', () => {
    console.log('ComPDFKit Web Demo');
  })
})