java.lang.Object | |
↳ | com.pspdfkit.document.checkpoint.PdfDocumentCheckpointer |
Handles documents checkpoint, cleaning and saving strategy.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
PdfDocumentCheckpointer(InternalPdfDocument document, File checkpointFile, CheckpointerConfiguration configuration) |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
checkpointExists()
Checks if a checkpoint for the document exists.
| ||||||||||
void |
deleteAllCheckpoints()
Deletes all checkpoints stored on-disk.
| ||||||||||
boolean |
deleteCheckpoint()
Deletes the checkpoint if exists.
| ||||||||||
Single<Boolean> |
deleteCheckpointAsync()
Asynchronously deletes the checkpoint.
| ||||||||||
PdfDocumentCheckpointingStrategy |
getStrategy()
Returns the strategy used for saving the checkpoint.
| ||||||||||
static boolean |
isCheckpointSupported(DocumentSource documentSource)
Returns
true if the checkpoint is supported. | ||||||||||
boolean |
isDirty()
Returns
true if the document has been modified since the last saving. | ||||||||||
void |
onAnnotationCreated(Annotation annotation)
Called when annotation has been created.
| ||||||||||
void |
onAnnotationRemoved(Annotation annotation)
Called when existing annotation has been removed.
| ||||||||||
void |
onAnnotationUpdated(Annotation annotation)
Called when existing annotation has changed.
| ||||||||||
void |
onAnnotationZOrderChanged(int pageIndex, List<Annotation> oldOrder, List<Annotation> newOrder)
Called when the z-order of annotations has changed on a specified page.
| ||||||||||
boolean |
saveCheckpoint()
Saves the checkpoint persistently on the local storage.
| ||||||||||
Single<Boolean> |
saveCheckpointAsync()
Saves the checkpoint asynchronously.
| ||||||||||
void |
setStrategy(PdfDocumentCheckpointingStrategy strategy)
Sets the strategy to use for saving the checkpoint.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Checks if a checkpoint for the document exists.
true
if a checkpoint exists, false
otherwise.
Deletes all checkpoints stored on-disk.
Deletes the checkpoint if exists.
true
if the checkpoint was deleted, false
otherwise.
Asynchronously deletes the checkpoint.
deleteCheckpointAsync
does not operate by default on a particular Scheduler.
true
if the checkpoint was deleted, false
otherwise.
Returns the strategy used for saving the checkpoint. See PdfDocumentCheckpointingStrategy
for exact behaviour. Note that MANUAL
is the strategy used by default.
Returns true
if the checkpoint is supported. Checkpointing is only supported for
unencrypted single-source documents.
documentSource | Document source to check. |
---|
true
if checkpoint is supported, false
otherwise.
Returns true
if the document has been modified since the last saving.
true
if the document has been modified, false
otherwise.
Called when annotation has been created.
annotation | Annotation that has been created. |
---|
Called when existing annotation has been removed.
annotation | Annotation that has been removed. |
---|
Called when existing annotation has changed.
annotation | Annotation that has been changed. |
---|
Called when the z-order of annotations has changed on a specified page.
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. |
Saves the checkpoint persistently on the local storage.
true
if the checkpoint was saved successfully, false
otherwise.
Saves the checkpoint asynchronously.
saveCheckpointAsync
does not operate by default on a particular Scheduler.
true
if the checkpoint was saved, false
otherwise.
Sets the strategy to use for saving the checkpoint. See PdfDocumentCheckpointingStrategy
for exact behaviour.
strategy | Strategy to use for saving the checkpoint. |
---|