Skip to main content
Version: 9.1

ScanButton (Anyline)

This form control is a button which starts a OCR scan of passports, id cards, driving licenses and license plates and fills in the scanned information. The control is implementing the Anyline OCR Scan plugin and postprocessing the scanned text.

Info

You will need an Anyline enterprise license! For further information please read on the Anyline website (https://anyline.com) or contact HybridForms support.

<div id="beteiligter_anyline_button_mrz"
data-win-control="HFWinJSCtrl.AnylinePicker"
data-win-options="{
buttonType: 'large',
buttonHeading: 'IDCard Scan',
buttonLabel: 'Backside',
scanType: 'MRZ',
addressScan: 'mandatory',
mapping: {
'pp_surname': 'beteiligter_nachname',
'pp_givenNames': 'beteiligter_vorname',
'dateOfBirthObject': 'beteiligter_geburtsdatum',
'sex': { type: 'radiobuttons', 'M': 'beteiligter_geschlecht_m', 'F': 'beteiligter_geschlecht_w', 'D': 'beteiligter_geschlecht_d' },
'pp_nationalityCountryCode2': 'beteiligter_staatsangerhoerigkeit',
'pp_nationalityCountryCode': 'beteiligter_staat',
'pp_nationalityCountryText': 'beteiligter_staat_HFComboText',
'pp_bundeslandCode': 'beteiligter_bundesland',
'pp_city': 'beteiligter_ort_HFComboText',
'pp_cityCode': 'beteiligter_plz',
'pp_address': 'beteiligter_strasse_HFComboText',
'pp_streetNumber': 'beteiligter_hausnummer'
},
audioFeedback: true,
vibrationFeedback: true,
callbackFeedback: true,
postProcess: HFFormdefinition.BaseHelpers.postProcessMRZ
}">
</div>

Add a custom Anyline Plugin configuration by using scanType: 'Custom' and the option customConfig:

<div id="anyline_custom_config" 
data-win-control="HFWinJSCtrl.AnylinePicker"
data-win-options="{
buttonType: 'large',
icon: 'fa-barcode-scan'
buttonHeading: 'IDCard Scan',
buttonLabel: 'MRZ',
scanType: 'custom',
mapping: {
'pp_surname': 'nachname',
'pp_givenNames': 'vorname',
'documentNumber': 'ausweisnr',
'dateOfExpiryObject': 'ausweis_gueltig_bis',
'dateOfBirthObject': 'geburtsdatum',
'sex': { type: 'radiobuttons', 'M': 'geschlecht_m', 'F': 'geschlecht_w' },
'pp_nationalityCountryCode': 'staat'
},
audioFeedback: true,
vibrationFeedback: true,
callbackFeedback: true,
postProcess: HFFormdefinition.BaselHelpers.postProcessMRZ,
customConfig: HFFormdefinition.BaselHelpers.getCustomAnylineConfig
}">
</div>

PropertyTypeHow to useDescription
addressScanStringaddressScan: 'mandatory',Set the option to mandatory if the scan result has to return address data. The default setting is optional.
buttonLabel**StringbuttonLabel: 'MRZ'Sets the label of the button (displayed if buttonType is "medium" or "large")
buttonType *StringbuttonType: 'large'Define the size of the button ('small', 'medium' or 'large').
buttonHeading**StringbuttonHeading: 'IDCard Scan'Define a label for the control element.
dateOfIssueStringaddressScan: 'mandatory',Set the option to mandatory if the scan result has to return date of issue if supported by document type. The default setting is optional.
icon**Stringicon: 'fa-barcode-scan'Sets the icon of the button
scanType *StringscanType: 'MRZ'Define the scanType, possible values are: LICENSE_PLATE, MRZ, VIN, OCR, Custom. DriverLicense and MRZFront are deprecated use UniversalID scan by setting Custom type instead.
mappingObjectmapping: {'pp_surname': 'nachname','pp_givenNames': 'vorname', ...An object with key-value pairs defining the Anyline scan fields and the receiving form fields
audioFeedbackBooleanaudioFeedback: trueEnables or disables an audible feedback on proccessing the scan
vibrationFeedbackBooleanvibrationFeedback: trueEnables or disables a haptic feedback on proccessing the scan
callbackFeedbackBooleancallbackFeedback: trueEnables or disables a audible feedback on success
charWhitelistStringcharWhitelist: 'ABCDE'Define the possible characters for OCR scanner.
validationRegexStringvalidationRegex: 'EMAIL'Define a validation regex for OCR scanner. More infos: https://documentation.anyline.com/toc/products/anyline_ocr/custom_ocr/index.html#validationregex
backScanPromptBooleanbackScanPrompt: trueActivate double side scan for supported documents (e.g. german id). After the front has been scanned, a prompt is shown to scan the back as well
afterScanFunction(result: any, options: any, element: HTMLElement)afterScan: HFFormdefinition.BaselHelpers.afterScanMRZCall a custom JS-method after result processing has finished (optional)
preProcessFunction(result: any, options: any, element: HTMLElement)preProcess: HFFormdefinition.BaselHelpers.preProcessMRZCall a custom JS-method to preProcess the scanned values (optional)
postProcessFunction(result: any, options: any, element: HTMLElement)postProcess: HFFormdefinition.BaselHelpers.postProcessMRZCall a custom JS-method to postprocess the scanned values (optional)
customConfigFunction(): anycustomConfig: HFFormdefinition.BaselHelpers.getCustomAnylineConfigCall a custom JS-method to provide your custom Anyline View configuration - scanType: 'Custom' required

* These options are required.
** Please provide at least one of these options ( depending on the button type).

Note

For further information on the Anyline Scanner especially the Anyline scan fields and the Anyline View configuration, please see the documentation at https://documentation.anyline.com/toc/platforms/cordova/index.html.