License Initialization
Get a trial license
The following shows how you can apply for a 30-day free trial license.
- Sign in the Customer Portal. Register for a Dynamsoft account if you haven’t already done so;
- Go to License > Trial License page, select the correct version and package/edition, then click “Register for a 30-Day Trial”;
- A 30-day private-trial license will be generated and the instruction on how to use it will show up on the page.
NOTE
In case the trial license fails to be generated, Dynamsoft Support team will get in touch with you. Or you can contact us.
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.
- C++
- JavaScript
- Android
- Objective-C
- Swift
int errorCode = 1; char errorMsg[512]; errorCode = CLicenseManager::InitLicense("YOUR-LICENSE-KEY", errorMsg, 512); if (errorCode != EC_OK) cout << "License initialization error: " << errorMsg << endl; // add further process
Dynamsoft.License.LicenseManager.initLicense("YOUR-LICENSE-KEY");
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)") } } }