Package io.scanbot.sdk.documentdata
Class DocumentDataExtractor
java.lang.Object
io.scanbot.sdk.documentdata.DocumentDataExtractor
- All Implemented Interfaces:
AutoCloseable
API for extracting data from documents.
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentDataExtractor(DocumentDataExtractorConfiguration configuration) Constructs DocumentDataExtractor with the given params. -
Method Summary
Modifier and TypeMethodDescriptionvoidClears the accumulated results.voidclose()Closes native resources held by the object.protected voidfinalize()Recognize the document in the given image.verifyDocument(List<GenericDocument> documentParts) Verify whether the extracted document has signs of forgery or tampering.
-
Constructor Details
-
DocumentDataExtractor
public DocumentDataExtractor(DocumentDataExtractorConfiguration configuration) throws LicenseException Constructs DocumentDataExtractor with the given params.- Parameters:
configuration- The configuration to use for the recognizer.- Throws:
LicenseException- If license requirements for the API are not met
-
-
Method Details
-
run
public DocumentDataExtractionResult run(ImageRef image) throws InvalidImageRefException, LicenseException Recognize the document in the given image.- Parameters:
image- The image to recognize.- Returns:
- The recognition result.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
clearResult
public void clearResult()Clears the accumulated results. Should be called after a document has been recognized to the customers satisfaction to prevent a poisoned cache. -
verifyDocument
public DocumentVerificationReport verifyDocument(List<GenericDocument> documentParts) throws InvalidImageRefException, LicenseException Verify whether the extracted document has signs of forgery or tampering.- Parameters:
documentParts- The document parts to verify. For example, the front and back of an ID card.- Returns:
- The verification report.
- Throws:
InvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not met
-
close
public void close()Closes native resources held by the object.- Specified by:
closein interfaceAutoCloseable
-
finalize
-