public interface Document
Due to the size limitations of the android.os.Bundle
, the document data byte array has to
be stored in a memory cache when parceling and read from the cache when unparceling.
Warning: Always retrieve the Document
extras from a Bundle to force unparceling
and removing of the reference to the byte array from the memory cache. Failing to do so will lead
to memory leaks.
Modifier and Type | Interface and Description |
---|---|
static class |
Document.ImportMethod
Enum of supported methods for importing documents.
|
static class |
Document.Source
Source of the document (e.g.
|
static class |
Document.Type
Supported document types.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getData()
The contents of a document, if the document was loaded into memory.
|
java.lang.String |
getId()
Retrieve the document's unique id.
|
Document.ImportMethod |
getImportMethod()
Retrieve with which method the document has been imported.
|
Intent |
getIntent()
The
Intent with which the imported document was received. |
byte[] |
getJpeg()
Deprecated.
Use
Document.getData() instead. This method might return a byte array
containing other types, like PDFs.
To check if the byte array contains an image query the type with |
java.lang.String |
getMimeType()
Retrieve the document's mime type (media type).
|
int |
getRotationForDisplay()
Deprecated.
Use
ImageDocument.getRotationForDisplay()
instead, if Document.getType() equals Document.Type.IMAGE . |
Document.Source |
getSource()
Retrieve from which source the document originates from.
|
Document.Type |
getType()
Get the concrete document type.
|
Uri |
getUri()
The
Uri of the imported document. |
boolean |
isImported()
Document is imported if it was picked from another app from the Camera Screen's document
upload button or if a file was passed to the Gini Vision Library through the client
application from another app.
|
boolean |
isReviewable()
Documents like PDFs are not reviewable and can be passed directly to the Analysis Screen.
|
java.lang.String getId()
@Deprecated byte[] getJpeg()
Document.getData()
instead. This method might return a byte array
containing other types, like PDFs.
To check if the byte array contains an image query the type with Document.getType()
and check if it equals Document.Type.IMAGE
.
@Deprecated int getRotationForDisplay()
ImageDocument.getRotationForDisplay()
instead, if Document.getType()
equals Document.Type.IMAGE
.The amount of clockwise rotation needed to display the image in the correct orientation.
Degrees are positive and multiples of 90.
Document.Type getType()
java.lang.String getMimeType()
byte[] getData()
The contents of a document, if the document was loaded into memory.
For photos captured with the camera or for QR Codes this is never null.
If Document.isImported()
is true
then this might be null. If it's null you can use Document.getIntent()
and access the contents using the Intent.
Intent getIntent()
The Intent
with which the imported document was received.
Intent
of the imported documentUri getUri()
The Uri
of the imported document.
Uri
boolean isImported()
Document is imported if it was picked from another app from the Camera Screen's document upload button or if a file was passed to the Gini Vision Library through the client application from another app.
true
if the document was importedDocument.ImportMethod getImportMethod()
Document.ImportMethod
Document.Source getSource()
Document.Source
boolean isReviewable()
Documents like PDFs are not reviewable and can be passed directly to the Analysis Screen. Reviewable documents have to be shown in the Review Screen first before passing it on to the Analysis Screen.
true
if the document can be reviewed in the Review Screen otherwise the
document has to be passed directly to the Analysis Screen