Web Demos

BARCODE READER SDK DEMO

Explore the flexibe barcode reading settings to optimize for your specific usage scenario.

WEB TWAIN SDK DEMO

Try the most popular web scanner features: scan images, import local images and PDF files, edit, save to local, upload to database, and etc.

BARCODE READER JAVASCRIPT DEMO

Transform any camera-equipped devices into real-time, browser-based barcode and QR code scanners.

MRZ SCANNER WEB DEMO

Detects the machine-readable zone of a passport, scans the text, and parses into human-readable data.

APP STORE DEMOS

BARCODE READER SDK FOR IOS

BARCODE READER SDK FOR ANDROID

VIEW MORE DEMOS >
Resource Base
Table of contents

License initialization

NOTE

The JavaScript edition doesn’t require a license as of version 2.0.3.

The method initLicenseFromDLS and DMDLSSettingParameters are no longer available from version 2.0.

To initialize the license for 2.0 or higher versions, please use the new license item illustrated on this page.

Get a trial key

  • A time-limited public trial key is available for every new device for the first use of Dynamsoft Camera Enhancer. The public trial key is the default key used in samples. You can also find the public trial key on the following parts of this page.
  • If your free key is expired, please visit Private Trial License Page to get an extension.

Get a full license

Initialize the license

The following code snippets are using the public trial key to initialize the license. You can replace the public trial key with your own license key.

Android Code Snippet

// The string "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" here will grant you a time-limited public trial license.
// After that, please visit: https://www.dynamsoft.com/customer/license/trialLicense?product=dce to request an extension.
CameraEnhancer.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", new DCELicenseVerificationListener() {
    @Override
    public void DCELicenseVerificationCallback(boolean b, Exception e) {
        if(!b && e != null){
            e.printStackTrace();
        }
    }
});

Objective-C Code Snippet

// The string "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" here will grant you a time-limited public trial license.
// After that, please visit: https://www.dynamsoft.com/customer/license/trialLicense?product=dce to request an extension.
[DynamsoftCameraEnhancer initLicense:@"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" verificationDelegate:self];
- (void)DCELicenseVerificationCallback:(bool)isSuccess error:(NSError *)error{
}

Swift Code Snippet

// The string "DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" here will grant you a time-limited public trial license.
// After that, please visit: https://www.dynamsoft.com/customer/license/trialLicense?product=dce to request an extension.
DynamsoftCameraEnhancer.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9",verificationDelegate:self)
func dceLicenseVerificationCallback(_ isSuccess: Bool, error: Error?) {
}

Optional Codes – Display License Verification Message on the UI

You can add the following code to the DCELicenseVerificationCallback to display the error message on the UI when the license verification is failed.

Android Code Snippet

CameraEnhancer.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9", new DCELicenseVerificationListener() {
    @Override
    public void DCELicenseVerificationCallback(boolean isSuccess, final Exception e) {
        if (!isSuccess) {
            e.printStackTrace();
            MainActivity.this.runOnUiThread(new Runnable() {
                @Override
                public void run() {
                    Toast ts = Toast.makeText(getBaseContext(), "error:"+((CameraEnhancerException)e).getErrorCode()+ " "+((CameraEnhancerException)e).getMessage(), Toast.LENGTH_LONG);
                    ts.show();
                }
            });
        }
    }
});

Objective-C Code Snippet

[DynamsoftCameraEnhancer initLicense:@"DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9" verificationDelegate:self];
- (void)DCELicenseVerificationCallback:(bool)isSuccess error:(NSError *)error{
    if(error != nil){
        dispatch_async(dispatch_get_main_queue(), ^{
            UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Server license verify failed" message:error.userInfo[NSUnderlyingErrorKey] preferredStyle:UIAlertControllerStyleAlert];
            [alert addAction:[UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil]];
            [self presentViewController:alert animated:YES completion:nil];
        });
    }
}

Swift Code Snippet

DynamsoftCameraEnhancer.initLicense("DLS2eyJvcmdhbml6YXRpb25JRCI6IjIwMDAwMSJ9",verificationDelegate:self)
func dceLicenseVerificationCallback(_ isSuccess: Bool, error: Error?) {
    let err = error as NSError?
    if(error != nil){
        DispatchQueue.main.async {
            let alert = UIAlertController(title: "Server license verify failed", message: err!.userInfo[NSUnderlyingErrorKey] as? String, preferredStyle: .alert)
            alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
            self.present(alert, animated: true, completion: nil)
        }
    }
}

This page is compatible for:

Version 1.0

Is this page helpful?

YesYes NoNo

In this article:

latest version

  • Latest version
  • Version 2.1.0
  • Version 2.0.0
  • Version 1.0.3
  • Version 1.0.1
  • Version 1.0.0
Change +
© 2003–2022 Dynamsoft. All rights reserved.
Privacy Statement / Site Map / Home / Purchase / Support