Skip to content

Latest commit

 

History

History
292 lines (266 loc) · 8.33 KB

set-full-license-v9.6.42.md

File metadata and controls

292 lines (266 loc) · 8.33 KB
layout title description keywords needAutoGenerateSidebar needGenerateH3Content noTitleIndex permalink
default-layout
How to set full license - Dynamsoft Barcode Reader Licensing
This page shows how to set full license of Dynamsoft Barcode Reader.
full license, licensing
true
true
false
/license-activation/set-full-license-v9.6.20.html

How to set full license in version 9.x

You can set the license by following the steps below:

Activate the license

Once you purchase a full license from Dynamsoft, you can find your license information in the Customer Portal (License | Full License).

To activate the license, click "Activate".

Activate

On the next page, set an Alias for your license or leave the default Alias, choose where you want the license to be hosted ("Dynamsoft's License Server" or "My Self-Hosted License Server") and click the "Activate" button.

Activate2

  1. Alias is a way to identify the license. You can set a meaningful Alias to a license so that you can easily identify the purpose of the license.

  2. In most cases, you should choose "Dynamsoft's License Server", choose "My Self-Hosted License Server" only when you have consulted us.

  3. You might be prompted to add the new license to an existing project or create a new project for this license.

On the following popup window, click the "OK" button.

Activate3

You will find that the License Key is listed on the license details page now.

Activate5

You can copy the License Key and use it in your application.

If you have other new licenses, you can follow the same steps to activate them.

A license usually expires one year after it is activated. Do not activate the license until you actually need to use it.

Configure the license by projects (optional)

If you have multiple projects which you want to manage the license usage separately, you can click the project name (found after "Linked Project Name") on the license details page to get to the configuration page. Read how to manage the project for more information.

Set the license in the code

Replace the trial license with the purchased license key:

>- JavaScript >- C >- C++ >- C# >- Java >- Android >- Objective-C >- Swift >- Python > > ```javascript Dynamsoft.DBR.BarcodeScanner.license = "YOUR-LICENSE-KEY"; let scanner = await Dynamsoft.DBR.BarcodeScanner.createInstance(); ``` > ```c int errorCode = 0; char errorBuf[512]; errorCode = DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); if (errorCode != DBR_OK) { // Add your code for license error processing; } // ... void* dbr = DBR_CreateInstance(); if(dbr != NULL) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance DBR_DestroyInstance(dbr); } ``` > ```cpp int errorCode = 0; char errorBuf[512]; errorCode = CBarcodeReader::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); if (errorCode != DBR_OK) { // Add your code for license error processing; } // ... CBarcodeReader* dbr = new CBarcodeReader(); if(dbr != NULL) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance delete dbr; } ``` > ```csharp string errorMsg; EnumErrorCode errorCode = BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg); if (errorCode != EnumErrorCode.DBR_SUCCESS) { // Add your code for license error processing; } // ... BarcodeReader reader = new BarcodeReader(); if (reader != null) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance reader.Dispose(); } ``` > ```java try { BarcodeReader.initLicense("YOUR-LICENSE-KEY"); // ... BarcodeReader reader = new BarcodeReader(); if(reader != null) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance reader.destroy(); } } catch (BarcodeReaderException ex) { // ... } ``` > ```java BarcodeReader.initLicense("YOUR-LICENSE-KEY", new DBRLicenseVerificationListener() { @Override public void DBRLicenseVerificationCallback(boolean isSuccessful, Exception e) { // Add your code for license verification. } }); ``` > ```objc [DynamsoftBarcodeReader initLicense:@"YOUR-LICENSE-KEY" verificationDelegate:self]; - (void)DBRLicenseVerificationCallback:(bool)isSuccess error:(NSError *)error { // Add your code for license verification. } ``` > ```swift DynamsoftBarcodeReader.initLicense("YOUR-LICENSE-KEY", verificationDelegate: self) func dbrLicenseVerificationCallback(_ isSuccess: Bool, error: Error?) { // Add your code for license verification. } ``` > ```python error = BarcodeReader.init_license("YOUR-LICENSE-KEY") if error[0] != EnumErrorCode.DBR_OK: # Add your code for license error processing # ... reader = BarcodeReader() if reader != None: # Add your code here to call decoding method, process barcode results and so on # ... # Release the allocated resources for the instance del reader ```

If you are using a concurrent instance license:

>- C >- C++ >- C# >- Java >- Python > > ```c int errorCode = 0; char errorBuf[512]; errorCode = DBR_InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); if (errorCode != DBR_OK) { // Add your code for license error processing; } // ... void* dbr = DBR_GetInstance(); if(dbr != NULL) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance DBR_RecycleInstance(dbr); } ``` > ```cpp int errorCode = 0; char errorBuf[512]; errorCode = CBarcodeReader::InitLicense("YOUR-LICENSE-KEY", errorBuf, 512); if (errorCode != DBR_OK) { // Add your code for license error processing; } // ... CBarcodeReader* dbr = CBarcodeReader::GetInstance(); if(dbr != NULL) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance dbr->Recycle(); } ``` > ```csharp string errorMsg; EnumErrorCode errorCode = BarcodeReader.InitLicense("YOUR-LICENSE-KEY", out errorMsg); if (errorCode != EnumErrorCode.DBR_SUCCESS) { // Add your code for license error processing; } // ... BarcodeReader reader = BarcodeReader.GetInstance(); if (reader != null) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance reader.Recycle(); } ``` > ```java try { BarcodeReader.initLicense("YOUR-LICENSE-KEY"); // ... BarcodeReader reader = BarcodeReader.getInstance(); if(reader != null) { // Add your code here to call decoding method, process barcode results and so on // ... // Release the allocated resources for the instance reader.recycle(); } } catch (BarcodeReaderException ex) { // ... } ``` > ```python error = BarcodeReader.init_license("YOUR-LICENSE-KEY") if error[0] != EnumErrorCode.DBR_OK: # Add your code for license error processing # ... reader = BarcodeReader.get_instance() if reader != None: # Add your code here to call decoding method, process barcode results and so on # ... # Release the allocated resources for the instance reader.recycle() ```

If you run into any issues, please contact Dynamsoft Support.