Package io.scanbot.sdk.docprocessing
Class Document
-
- All Implemented Interfaces:
public final class Document
Represents a document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
Document.Companion
-
Field Summary
Fields Modifier and Type Field Description private final <Error class: unknown class><List<Page>>
pagesFlow
private final List<Page>
pages
private String
uuid
private Long
creationTimeStamp
private Integer
documentImageSizeLimit
private final Integer
pageCount
private final Uri
pdfUri
private final Uri
tiffUri
public final static Document.Companion
Companion
-
Constructor Summary
Constructors Constructor Description Document(DocumentStorage documentStorage, PageFileStorage pageFileStorage, FileIOProcessor fileIOProcessor)
Document(DocumentStorage documentStorage, PageFileStorage pageFileStorage, FileIOProcessor fileIOProcessor, Integer documentImageSizeLimit)
Document(DocumentStorage documentStorage, PageFileStorage pageFileStorage, FileIOProcessor fileIOProcessor, String documentId, Boolean createIfNotExist, Integer documentImageSizeLimit)
-
Method Summary
Modifier and Type Method Description final <Error class: unknown class><List<Page>>
getPagesFlow()
The flow of pages in the document. final List<Page>
getPages()
final String
getUuid()
final Unit
setUuid(String uuid)
final Long
getCreationTimeStamp()
final Unit
setCreationTimeStamp(Long creationTimeStamp)
final Integer
getDocumentImageSizeLimit()
final Unit
setDocumentImageSizeLimit(Integer documentImageSizeLimit)
final Integer
getPageCount()
final Uri
getPdfUri()
final Uri
getTiffUri()
final List<String>
pageIds()
Returns the list of ids of the pages. final Page
pageWithId(String uuid)
Returns the page with the given id. final Page
pageAtIndex(Integer index)
Returns the page with the given index. final Page
addPage(ByteArray image)
Adds original image in the storage, and returns pageId. final Page
addPage(Bitmap image)
Adds original image in the storage, and returns pageId. final Page
addPage(Uri imageUri)
Adds original image in the storage, and returns pageId. final Page
insertPage(ByteArray image, Integer index)
Inserts original image with the given index, and returns Page. final Page
insertPage(Bitmap image, Integer index)
Inserts original image with the given index, and returns Page. final Boolean
removePage(Page page)
Remove the given page. final Boolean
removePage(Integer atIndex)
Remove the page with the given index. final Boolean
removePage(String pageUuid)
Remove the page with the given id. final Unit
removeAllPages()
Remove all page from the document at one batch operation. final Boolean
movePage(Integer sourceIndex, Integer destinationIndex)
Move the page with the given index to the destination index. final Unit
sortPagesById(List<String> pageIds)
Rearranges the order of pages due to order of passed Page IDs. final Unit
delete()
Deletes the document. final Unit
saveSync()
Saves the document synchronously. final Document
loadSync(Boolean createIfNotExist)
Loads the document synchronously. final Document
clone()
Creates a deep copy of the existing document with a new unique UUID, adjust JSON to new UUID and return the newly created Document. final Document
duplicate(String newUuid, Boolean overwrite)
Copy document folder recursively under a new uuid, adjust JSON to newUuid and return the newly created Document. final String
toJson()
Returns the JSON representation of the document. -
-
Constructor Detail
-
Document
Document(DocumentStorage documentStorage, PageFileStorage pageFileStorage, FileIOProcessor fileIOProcessor)
-
Document
Document(DocumentStorage documentStorage, PageFileStorage pageFileStorage, FileIOProcessor fileIOProcessor, Integer documentImageSizeLimit)
-
Document
Document(DocumentStorage documentStorage, PageFileStorage pageFileStorage, FileIOProcessor fileIOProcessor, String documentId, Boolean createIfNotExist, Integer documentImageSizeLimit)
-
-
Method Detail
-
getPagesFlow
final <Error class: unknown class><List<Page>> getPagesFlow()
The flow of pages in the document.
-
getCreationTimeStamp
final Long getCreationTimeStamp()
-
setCreationTimeStamp
final Unit setCreationTimeStamp(Long creationTimeStamp)
-
getDocumentImageSizeLimit
final Integer getDocumentImageSizeLimit()
-
setDocumentImageSizeLimit
final Unit setDocumentImageSizeLimit(Integer documentImageSizeLimit)
-
getPageCount
final Integer getPageCount()
-
getTiffUri
final Uri getTiffUri()
-
pageWithId
final Page pageWithId(String uuid)
Returns the page with the given id.
-
pageAtIndex
final Page pageAtIndex(Integer index)
Returns the page with the given index.
-
insertPage
final Page insertPage(ByteArray image, Integer index)
Inserts original image with the given index, and returns Page.
-
insertPage
final Page insertPage(Bitmap image, Integer index)
Inserts original image with the given index, and returns Page.
-
removePage
final Boolean removePage(Page page)
Remove the given page.
-
removePage
final Boolean removePage(Integer atIndex)
Remove the page with the given index.
-
removePage
final Boolean removePage(String pageUuid)
Remove the page with the given id.
-
removeAllPages
final Unit removeAllPages()
Remove all page from the document at one batch operation.
-
movePage
final Boolean movePage(Integer sourceIndex, Integer destinationIndex)
Move the page with the given index to the destination index.
-
sortPagesById
final Unit sortPagesById(List<String> pageIds)
Rearranges the order of pages due to order of passed Page IDs.
-
clone
final Document clone()
Creates a deep copy of the existing document with a new unique UUID, adjust JSON to new UUID and return the newly created Document. Creates a deep copy of the each page with a new unique UUIDs.
-
-
-
-