Package io.scanbot.sdk.documentdata
Class DocumentDataExtractor
- java.lang.Object
-
- io.scanbot.sdk.documentdata.DocumentDataExtractor
-
- All Implemented Interfaces:
java.lang.AutoCloseable
public class DocumentDataExtractor extends java.lang.Object implements java.lang.AutoCloseableAPI for extracting data from documents.
-
-
Constructor Summary
Constructors Constructor Description DocumentDataExtractor(DocumentDataExtractorConfiguration configuration)Constructs DocumentDataExtractor with the given params.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclearResult()Clears the accumulated results.voidclose()Closes native resources held by the object.protected voidfinalize()DocumentDataExtractionResultrun(ImageRef image)Recognize the document in the given image.DocumentVerificationReportverifyDocument(java.util.List<GenericDocument> documentParts)Verify whether the extracted document has signs of forgery or tampering.
-
-
-
Constructor Detail
-
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 Detail
-
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(java.util.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 interfacejava.lang.AutoCloseable
-
finalize
protected void finalize() throws java.lang.Throwable- Overrides:
finalizein classjava.lang.Object- Throws:
java.lang.Throwable
-
-