Class Document

  • All Implemented Interfaces:

    
    public final class Document
    
                        

    Represents a document.

    • Method Detail

      • getPagesFlow

         final <Error class: unknown class><List<Page>> getPagesFlow()

        The flow of pages in the document.

      • 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.

      • duplicate

         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. 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.

      • toJson

         final String toJson()

        Returns the JSON representation of the document.