ID

MRZ (Identity documents) Example

// import the Web SDK
const { init, errorCodes } = window.anylinejs;

// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';


// create a view configuration
const viewConfig = {
    ...
};

const anylicense = 'xxxxxxx-your-license-xxxxxxx';

// access the container you want to mount the Web SDK into
const root = document.getElementById('root');

// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
// preset: use the preset 'universalid_mrz' or the config:
//    config: {
//      module: 'id',
//        mrzConfig: {
//          minConfidence: 50,
//        },
//      },
//    },

const Anyline = init({
    preset: 'universalid_mrz',
    viewConfig,
    license: anylicense,
    element: root,
});


Anyline.startScanning();

Anyline.onResult = function(result) {
    console.log('Anyline has result: ', result);
};

E-card Example

// import the Web SDK
const { init, errorCodes } = window.anylinejs;

// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';


// create a view configuration
const viewConfig = {
    ...
};

const anylicense = 'xxxxxxx-your-license-xxxxxxx';

// access the container you want to mount the Web SDK into
const root = document.getElementById('root');

// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
    preset: 'ehic',
    viewConfig,
    license: anylicense,
    element: root,
});

Anyline.startScanning();

Anyline.onResult = function(result) {
    console.log('Anyline has result: ', result);
};

Identification Document Detection Example

The Anyline Identification Document Detection feature can be used to detect a card and/or MRZ content for a given frame. No OCR will be processed, the result contains boolean values (returned as a string) to indicate if the scanning process detected either a card or MRZ content.

A sample result for an image containing a card with no MRZ content (e.g. an e-card) would be:

[
  {
    "identifier": "detectedCard",
    "text": "1"
  },
  {
    "identifier": "detectedMRZ",
    "text": "0"
  }
]

If a passport or ID card with MRZ content is scanned the result would indicate "1" for the result identifier "detectMRZ" and add an additional convenience result variable "MRZType" that indicates the ICAO type of the detected MRZ document.

[
  {
    "identifier": "detectedCard",
    "text": "1"
  },
  {
    "identifier": "detectedMRZ",
    "text": "1"
  },
  {
    "identifier": "MRZType",
    "text": "TD1"
  }
]

The following example code activates the full frame image ("fullImage") to be returned as well as the cutout ("image") together with the above-described JSON "result".

// import the Web SDK
const { init, errorCodes } = window.anylinejs;

// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';


// create a view configuration
const viewConfig = {
    returnFullImage: true,
    ...
};

const anylicense = 'xxxxxxx-your-license-xxxxxxx';

// access the container you want to mount the Web SDK into
const root = document.getElementById('root');

// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
    preset: 'card_detect',
    viewConfig,
    license: anylicense,
    element: root,
});

Anyline.startScanning();

Anyline.onResult = function( image, fullImage, result ) {
    console.log('Anyline has result: ', result);
};

Driving License Example

The Anyline Driving License mode provides the functionality to scan Austrian, German and UK driving licenses.

// import the Web SDK
const { init, errorCodes } = window.anylinejs;

// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';


// create a view configuration
const viewConfig = {
    ...
};

const anylicense = 'xxxxxxx-your-license-xxxxxxx';

// access the container you want to mount the Web SDK into
const root = document.getElementById('root');

// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
    preset: 'drivingLicense',
    viewConfig,
    license: anylicense,
    element: root,
});

Anyline.startScanning();

Anyline.onResult = function(result) {
    console.log('Anyline has result: ', result);
};

German ID Front Example

The Anyline German ID Front mode provides the functionality to scan the front side of German ID cards.

// import the Web SDK
const { init, errorCodes } = window.anylinejs;

// if copied into node_modules
// import { init, errorCodes } from 'anyline-js';


// create a view configuration
const viewConfig = {
    ...
};

const anylicense = 'xxxxxxx-your-license-xxxxxxx';

// access the container you want to mount the Web SDK into
const root = document.getElementById('root');

// initialize the Web SDK with optional presets
// presets will override some dimension configuration of your viewConfig and modules in the Web SDK config
const Anyline = init({
    preset: 'germanid',
    viewConfig,
    license: anylicense,
    element: root,
});

Anyline.startScanning();

Anyline.onResult = function(result) {
    console.log('Anyline has result: ', result);
};