Class PdfDocumentCheckpointer

    • Constructor Detail

      • PdfDocumentCheckpointer

        PdfDocumentCheckpointer(InternalPdfDocument document, File checkpointFile, CheckpointerConfiguration configuration)
    • Method Detail

      • isCheckpointSupported

         static boolean isCheckpointSupported(@NonNull() DocumentSource documentSource)

        Returns true if the checkpoint is supported. Checkpointing is only supported for unencrypted single-source documents.

        Parameters:
        documentSource - Document source to check.
        Returns:

        true if checkpoint is supported, false otherwise.

      • documentSavedSuccessfully

         void documentSavedSuccessfully()

        Logs that the saving succeeded and resets the dirty status of the document to false.

      • saveCheckpointAsync

        @NonNull() Single<Boolean> saveCheckpointAsync()

        Saves the checkpoint asynchronously.

        • Scheduler:
        • saveCheckpointAsync does not operate by default on a particular .
        Returns:

        Single returning true if the checkpoint was saved, false otherwise.

      • deleteCheckpointAsync

        @NonNull() Single<Boolean> deleteCheckpointAsync()

        Asynchronously deletes the checkpoint.

        • Scheduler:
        • deleteCheckpointAsync does not operate by default on a particular .
        Returns:

        Single returning true if the checkpoint was deleted, false otherwise.

      • checkpointExists

         boolean checkpointExists()

        Checks if a checkpoint for the document exists.

        Returns:

        true if a checkpoint exists, false otherwise.

      • saveCheckpoint

         boolean saveCheckpoint()

        Saves the checkpoint persistently on the local storage.

        Returns:

        true if the checkpoint was saved successfully, false otherwise.

      • deleteCheckpoint

         boolean deleteCheckpoint()

        Deletes the checkpoint if exists.

        Returns:

        true if the checkpoint was deleted, false otherwise.

      • isDirty

         boolean isDirty()

        Returns true if the document has been modified since the last saving.

        Returns:

        true if the document has been modified, false otherwise.

      • isSaving

         boolean isSaving()

        Returns whether or not the checkpointer is currently saving to the document.

      • onAnnotationCreated

         void onAnnotationCreated(@NonNull() Annotation annotation)

        Called when annotation has been created.

        Parameters:
        annotation - Annotation that has been created.
      • onAnnotationUpdated

         void onAnnotationUpdated(@NonNull() Annotation annotation)

        Called when existing annotation has changed.

        Parameters:
        annotation - Annotation that has been changed.
      • onAnnotationRemoved

         void onAnnotationRemoved(@NonNull() Annotation annotation)

        Called when existing annotation has been removed.

        Parameters:
        annotation - Annotation that has been removed.
      • onAnnotationZOrderChanged

         void onAnnotationZOrderChanged(int pageIndex, @NonNull() List<Annotation> oldOrder, @NonNull() List<Annotation> newOrder)

        Called when the z-order of annotations has changed on a specified page.

        Parameters:
        pageIndex - Index of the page where the z-order has changed.
        oldOrder - The old order of annotations on the page.
        newOrder - The new order of annotations on the page.