Official Card Auto-Capture
The ID card auto-capture also handles Thai driver licenses, bank passbooks (book bank) and ID card copies with signature, and sends each to its OCR API at 1.25 IC per page.
Call
- Flutter
- Web
- iOS
- Android
- React Native
import 'package:iapp_ekyc_sdk/iapp_ekyc_sdk.dart';
final client = IappEkycClient(apiKey: 'YOUR_API_KEY');
// Thai driver license
final license = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.thaiDriverLicense,
locale: EkycLocale.th,
);
// Bank passbook
final bookBank = await DocumentCaptureView.start(
context,
client: client,
documentType: DocumentType.bookBank,
);
import { IappEkyc } from '@iapp-technology/ekyc-sdk';
const ekyc = new IappEkyc({ apiKey: 'YOUR_API_KEY' });
const license = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'thaiDriverLicense',
locale: 'th',
});
const idCopy = await ekyc.captureDocument({
mount: document.getElementById('ekyc-mount'),
documentType: 'thaiIdWithSignature',
});
// iOS (Swift; Objective-C also supported)
let config = IappEkycConfig(apiKey: "YOUR_API_KEY", flow: .documentCapture)
config.documentType = .thaiDriverLicense
IappEkycSdk.present(from: self, config: config) { result in /* result.document?.rawJSON */ }
// Android (Kotlin; Java also supported)
ekyc.launch(IappEkycRequest.DocumentCapture(config, EkycDocumentType.THAI_DRIVER_LICENSE))
// React Native
<IappEkycFlow flow="documentCapture" documentType="thaiDriverLicense" apiKey="YOUR_API_KEY"
onResult={handleResult} onError={handleError} onCancel={close} />
Install: Getting started for Flutter and Web, iOS, Android & React Native for the native wrappers and camera permission.
Options
documentType picks the document and the API it is sent to:
| Document | Flutter | Web | API |
|---|---|---|---|
| Driver license | DocumentType.thaiDriverLicense | 'thaiDriverLicense' | Thai Driver License OCR |
| Bank passbook | DocumentType.bookBank | 'bookBank' | Book Bank OCR |
| ID card copy with signature | DocumentType.thaiIdWithSignature | 'thaiIdWithSignature' | Thai National ID Card with Signature |
locale sets the on-screen language: en, th or zh (EkycLocale.th in Flutter).
Result
The result has typed fields plus the raw OCR response in result.raw (result.document?.rawJSON on iOS). The field list is on each API's page, linked in the table above.
How auto-capture works
- Boundary: a four-sided shape in the on-screen guide matching the ID-1 card aspect ratio of 1.586, within ±0.25. Driver licenses, bank passbooks and ID copies all share the ID-1 size.
- Stability: the document must stay steady across recent frames, its corners drifting less than 2% of the frame diagonal.
- Sharpness: blurry frames are rejected before any credit is spent.
- Perspective correction: the corners are warped to a flat image of about 300 DPI (1011 × 637 px) before upload.
- Manual fallback: a shutter button appears after 10 seconds if auto-capture has not fired.
The full algorithm specification is in the SDK source.