Class Document
-
- All Implemented Interfaces:
public final class DocumentRepresents a document.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDocument.Companion
-
Field Summary
Fields Modifier and Type Field Description private final <Error class: unknown class><List<Page>>pagesFlowprivate final List<Page>pagesprivate Stringuuidprivate LongcreationTimeStampprivate IntegerdocumentImageSizeLimitprivate final IntegerpageCountprivate final UripdfUriprivate final UritiffUripublic final static Document.CompanionCompanion
-
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 StringgetUuid()final UnitsetUuid(String uuid)final LonggetCreationTimeStamp()final UnitsetCreationTimeStamp(Long creationTimeStamp)final IntegergetDocumentImageSizeLimit()final UnitsetDocumentImageSizeLimit(Integer documentImageSizeLimit)final IntegergetPageCount()final UrigetPdfUri()final UrigetTiffUri()final List<String>pageIds()Returns the list of ids of the pages. final PagepageWithId(String uuid)Returns the page with the given id. final PagepageAtIndex(Integer index)Returns the page with the given index. final PageaddPage(ByteArray image)Adds original image in the storage, and returns pageId. final PageaddPage(Bitmap image)Adds original image in the storage, and returns pageId. final PageaddPage(Uri imageUri)Adds original image in the storage, and returns pageId. final PageinsertPage(ByteArray image, Integer index)Inserts original image with the given index, and returns Page. final PageinsertPage(Bitmap image, Integer index)Inserts original image with the given index, and returns Page. final BooleanremovePage(Page page)Remove the given page. final BooleanremovePage(Integer atIndex)Remove the page with the given index. final BooleanremovePage(String pageUuid)Remove the page with the given id. final UnitremoveAllPages()Remove all page from the document at one batch operation. final BooleanmovePage(Integer sourceIndex, Integer destinationIndex)Move the page with the given index to the destination index. final UnitsortPagesById(List<String> pageIds)Rearranges the order of pages due to order of passed Page IDs. final Unitdelete()Deletes the document. final UnitsaveSync()Saves the document synchronously. final DocumentloadSync(Boolean createIfNotExist)Loads the document synchronously. final Documentclone()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 Documentduplicate(String newUuid, Boolean overwrite)Copy document folder recursively under a new uuid, adjust JSON to newUuid and return the newly created Document. final StringtoJson()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.
-
addPage
final Page addPage(ByteArray image)
Adds original image in the storage, and returns pageId. This is an IO operation and is not recommended to execute in the UI thread.
-
addPage
final Page addPage(Bitmap image)
Adds original image in the storage, and returns pageId. This is an IO operation and is not recommended to execute in the UI thread.
-
addPage
final Page addPage(Uri imageUri)
Adds original image in the storage, and returns pageId. This is an IO operation and is not recommended to execute in the UI thread.
- Parameters:
imageUri- the file URI of the image to be added.
-
insertPage
final Page insertPage(ByteArray image, Integer index)
Inserts original image with the given index, and returns Page. This is an IO operation and is not recommended to execute in the UI thread.
-
insertPage
final Page insertPage(Bitmap image, Integer index)
Inserts original image with the given index, and returns Page. This is an IO operation and is not recommended to execute in the UI thread.
-
removePage
final Boolean removePage(Page page)
Remove the given page. This is an IO operation and is not recommended to execute in the UI thread.
-
removePage
final Boolean removePage(Integer atIndex)
Remove the page with the given index. This is an IO operation and is not recommended to execute in the UI thread.
-
removePage
final Boolean removePage(String pageUuid)
Remove the page with the given id. This is an IO operation and is not recommended to execute in the UI thread.
-
removeAllPages
final Unit removeAllPages()
Remove all page from the document at one batch operation. This is an IO operation and is not recommended to execute in the UI thread.
-
movePage
final Boolean movePage(Integer sourceIndex, Integer destinationIndex)
Move the page with the given index to the destination index. This is an IO operation and is not recommended to execute in the UI thread.
-
sortPagesById
final Unit sortPagesById(List<String> pageIds)
Rearranges the order of pages due to order of passed Page IDs. This is an IO operation and is not recommended to execute in the UI thread.
-
delete
final Unit delete()
Deletes the document. This is an IO operation and is not recommended to execute in the UI thread.
-
saveSync
final Unit saveSync()
Saves the document synchronously. This is an IO operation and is not recommended to execute in the UI thread.
-
loadSync
final Document loadSync(Boolean createIfNotExist)
Loads the document synchronously. This is an IO operation and is not recommended to execute in the UI thread.
-
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. This is an IO operation and is not recommended to execute in the UI thread.
-
-
-
-