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.
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>
Property | Type | How to use | Description |
---|---|---|---|
addressScan | String | addressScan: 'mandatory', | Set the option to mandatory if the scan result has to return address data. The default setting is optional . |
buttonLabel** | String | buttonLabel: 'MRZ' | Sets the label of the button (displayed if buttonType is "medium" or "large") |
buttonType * | String | buttonType: 'large' | Define the size of the button ('small', 'medium' or 'large'). |
buttonHeading** | String | buttonHeading: 'IDCard Scan' | Define a label for the control element. |
dateOfIssue | String | addressScan: '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** | String | icon: 'fa-barcode-scan' | Sets the icon of the button |
scanType * | String | scanType: '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. |
mapping | Object | mapping: {'pp_surname': 'nachname','pp_givenNames': 'vorname', ... | An object with key-value pairs defining the Anyline scan fields and the receiving form fields |
audioFeedback | Boolean | audioFeedback: true | Enables or disables an audible feedback on proccessing the scan |
vibrationFeedback | Boolean | vibrationFeedback: true | Enables or disables a haptic feedback on proccessing the scan |
callbackFeedback | Boolean | callbackFeedback: true | Enables or disables a audible feedback on success |
charWhitelist | String | charWhitelist: 'ABCDE' | Define the possible characters for OCR scanner. |
validationRegex | String | validationRegex: 'EMAIL' | Define a validation regex for OCR scanner. More infos: https://documentation.anyline.com/toc/products/anyline_ocr/custom_ocr/index.html#validationregex |
backScanPrompt | Boolean | backScanPrompt: true | Activate 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 |
afterScan | Function(result: any, options: any, element: HTMLElement) | afterScan: HFFormdefinition.BaselHelpers.afterScanMRZ | Call a custom JS-method after result processing has finished (optional) |
preProcess | Function(result: any, options: any, element: HTMLElement) | preProcess: HFFormdefinition.BaselHelpers.preProcessMRZ | Call a custom JS-method to preProcess the scanned values (optional) |
postProcess | Function(result: any, options: any, element: HTMLElement) | postProcess: HFFormdefinition.BaselHelpers.postProcessMRZ | Call a custom JS-method to postprocess the scanned values (optional) |
customConfig | Function(): any | customConfig: HFFormdefinition.BaselHelpers.getCustomAnylineConfig | Call 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).
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.