Dev Center
Table of contents

License Initialization

Get a trial license

You can request a 30-day trial license via the Request a Trial License link.

You can contact our support team via the Contacting Us link when:

  • You want request for an Offline trial license.
  • Your license generation failed.

Get a Full License

Contact us to purchase a full license.

Set the License In the Code

The following shows how to set the license in the code.

  • JavaScript
  • C
  • C++
  • C#
  • Java
  • Android
  • Objective-C
  • Swift
  • Python
Dynamsoft.License.LicenseManager.initLicense("YOUR-LICENSE-KEY");
  char errorBuf[512];
  DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512);
  void* barcodeReader = DBR_CreateInstance();
  // add further process
    int errorCode = 1;
    char errorMsg[512];
    errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorMsg, 512);
    if (errorCode != EC_OK)
        cout << "License initialization error: " << errorMsg << endl;
    CCaptureVisionRouter *cvr = new CCaptureVisionRouter;
    // add further process
  int errorCode = 0;
  string errorMsg;
  errorCode = LicenseManager.InitLicense("--Enter Your License Key Here--", out errorMsg);
  if (errorCode != (int)EnumErrorCode.EC_OK && errorCode != (int)EnumErrorCode.EC_LICENSE_CACHE_USED)
  {
      Console.WriteLine("License initialization error: " + errorMsg);
  }
  else
  {
      CaptureVisionRouter cvr = new CaptureVisionRouter();
      // add code for further process
  }
  BarcodeReader.initLicense("YOUR-LICENSE-KEY");
  BarcodeReader reader = new BarcodeReader();
  // add further process
LicenseManager.initLicense("YOUR-LICENSE-KEY", this, (isSuccess, error) -> {
   if (!isSuccess) {
          error.printStackTrace();
   }
});
[DSLicenseManager initLicense:@"YOUR-LICENSE-KEY" verificationDelegate:self];
- (void)onLicenseVerified:(BOOL)isSuccess error:(nullable NSError *)error {
    if (!isSuccess && error != nil) {
        NSLog(@"error: %@", error);
    }
}
LicenseManager.initLicense("YOUR-LICENSE-KEY", verificationDelegate: self)
func onLicenseVerified(_ isSuccess: Bool, error: Error?) {
   if !isSuccess {
          if let error = error {
             print("\(error.localizedDescription)")
          }
   }
}
error_code = 0
error_code, error_msg = LicenseManager.init_license("--Enter Your License Key Here--")
if error_code != EnumErrorCode.EC_OK.value and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED.value:
    print("License initialization error: " + error_msg)
else:
    CaptureVisionRouter cvr = new CaptureVisionRouter()
    # add code for further process

If you are using a concurrent instance license, you need to apply two more operations:

  • Call method SetMaxConcurrentInstanceCount to set the license count you purchased.
  • Update the parameter MaxParallelTasks to align with the purchased quantity.
  • C++
  • C#
  • Python
    int licenseCount = YOUR-PURCHASED-LICENSE-COUNT;
    int errorCode = 1;
    char errorMsg[512];
    // Set the license count you purchased
    SetMaxConcurrentInstanceCount(licenseCount);
    errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorMsg, 512);
    if (errorCode != EC_OK)
        cout << "License initialization error: " << errorMsg << endl;
    CCaptureVisionRouter *cvr = new CCaptureVisionRouter;
    // Update parameter maxParallelTasks
    SimplifiedCaptureVisionSettings setting;
    cvr->GetSimplifiedSettings(CPresetTemplate::PT_READ_BARCODES, &setting);
    setting.maxParallelTasks = licenseCount;
    cvr->UpdateSettings(CPresetTemplate::PT_READ_BARCODES, &setting);
    // add further process
    int licenseCount = YOUR-PURCHASED-LICENSE-COUNT;
    int errorCode = 0;
    string errorMsg;
    errorCode = LicenseManager.InitLicense("YOUR-LICENSE-KEY", out errorMsg);
    LicenseManager.SetMaxConcurrentInstanceCount(licenseCount)
    if (errorCode != (int)EnumErrorCode.EC_OK && errorCode != (int)EnumErrorCode.EC_LICENSE_CACHE_USED)
    {
        Console.WriteLine("License initialization error: " + errorMsg);
    }
    else
    {
        CaptureVisionRouter cvr = new CaptureVisionRouter();
        SimplifiedCaptureVisionSettings settings;
        cvr.GetSimplifiedSettings(PresetTemplate.PT_READ_BARCODES, out settings);
        setting.maxParallelTasks = licenseCount;
        cvr.UpdateSettings(PresetTemplate.PT_READ_BARCODES, settings, out errorMsg);
        // add code for further process
    }
license_count = YOUR-PURCHASED-LICENSE-COUNT
LicenseManager.set_max_concurrent_instance_count(license_count)
error_code, error_msg = LicenseManager.init_license("YOUR-LICENSE-KEY")
if error_code != EnumErrorCode.EC_OK.value and error_code != EnumErrorCode.EC_LICENSE_CACHE_USED.value:
    print("License initialization error: " + error_msg)
else:
    CaptureVisionRouter cvr = new CaptureVisionRouter()
    error_code, error_msg, settings = cvr.get_simplified_settings(EnumPresetTemplate.PT_READ_BARCODES.value)
    settings.max_parallel_tasks = license_count
    error_code, error_msg = cvr.update_settings(EnumPresetTemplate.PT_READ_BARCODES.value, settings)
    # add code for further process

This page is compatible for:

Is this page helpful?

YesYes NoNo

latest version

  • Latest version
  • Version 10.x
    • Version 10.2.0
    • Version 10.0.21
    • Version 10.0.20
    • Version 10.0.10
    • Version 10.0.0
  • Version 9.x
    • Version 9.6.42
    • Version 9.6.40
    • Version 9.6.33
    • Version 9.6.32
    • Version 9.6.31
    • Version 9.6.30
    • Version 9.6.20
    • Version 9.6.10
    • Version 9.6.0
    • Version 9.4.0
    • Version 9.2.0
    • Version 9.0.0
  • Version 8.x
    • Version 8.8.0
    • Version 8.6.0
    • Version 8.4.0
    • Version 8.2.0
    • Version 8.1.2
    • Version 8.1.0
    • Version 8.0.0
  • Version 7.x
    • Version 7.6.0
    • Version 7.5.0
  • Documentation Homepage
Change +