public interface

ImageDocument

com.pspdfkit.document.ImageDocument

Class Overview

An image document. To create an instance use openDocument(Context, Uri) or openDocument(Context, DocumentSource) or related static async methods.

Summary

Public Methods
abstract PdfDocument getDocument()
Gets the converted Pdf document.
abstract DocumentSource getImageDocumentSource()
Returns the image document source which may be a DataProvider or a file Uri.
abstract boolean isValidForEditing()
Returns true if the document is editable (comes from a file URI or from another source that supports writing), false otherwise.
abstract boolean saveIfModified(DocumentSaveOptions documentSaveOptions, boolean metadata)
Saves the image document to its original location if it has been changed.
abstract boolean saveIfModified()
Saves the image document to its original location if it has been changed.
abstract boolean saveIfModified(boolean metadata)
Saves the image document to its original location if it has been changed.
abstract Single<Boolean> saveIfModifiedAsync(boolean metadata)
Saves the image document to its original location if it has been changed.
abstract Single<Boolean> saveIfModifiedAsync(DocumentSaveOptions documentSaveOptions, boolean metadata)
Saves the image document to its original location if it has been changed.
abstract Single<Boolean> saveIfModifiedAsync()
Saves the image document to its original location if it has been changed.

Public Methods

public abstract PdfDocument getDocument ()

Gets the converted Pdf document.

Returns
  • Pdf document converted from image document.

public abstract DocumentSource getImageDocumentSource ()

Returns the image document source which may be a DataProvider or a file Uri.

Returns
  • The image document source.

public abstract boolean isValidForEditing ()

Returns true if the document is editable (comes from a file URI or from another source that supports writing), false otherwise.

Returns
  • true if the document supports editing, false otherwise.

public abstract boolean saveIfModified (DocumentSaveOptions documentSaveOptions, boolean metadata)

Saves the image document to its original location if it has been changed. If there were no changes, the image document file will not be modified. Note that this may take a while and should not be called on the main thread.

Parameters
documentSaveOptions Save options for the document.
metadata If true image document will be saved to its original location together with the generated Pdf document in the metadata, when false Pdf in the metadata will be purged if any, and the saving will take effect persistently.
Returns
  • true if the file was modified and changes were saved. false if there was nothing to save.

public abstract boolean saveIfModified ()

Saves the image document to its original location if it has been changed. If there were no changes, the image document file will not be modified. Note that this may take a while and should not be called on the main thread.

Returns
  • true if the file was modified and changes were saved. false if there was nothing to save.

public abstract boolean saveIfModified (boolean metadata)

Saves the image document to its original location if it has been changed. If there were no changes, the image document file will not be modified. Note that this may take a while and should not be called on the main thread.

Parameters
metadata If true image document will be saved to its original location together with the generated Pdf document in the metadata, when false Pdf in the metadata will be purged if any, and the saving will take effect persistently.
Returns
  • true if the file was modified and changes were saved. false if there was nothing to save.

public abstract Single<Boolean> saveIfModifiedAsync (boolean metadata)

Saves the image document to its original location if it has been changed. If there were no changes, the image document file will not be modified. Note that this may take a while and should not be called on the main thread.

Parameters
metadata If true image document will be saved to its original location together with the generated Pdf document in the metadata, when false Pdf in the metadata will be purged if any, and the saving will take effect persistently.
Returns
  • Single observable returning true if the file was modified and changes were saved. false if there was nothing to save.

public abstract Single<Boolean> saveIfModifiedAsync (DocumentSaveOptions documentSaveOptions, boolean metadata)

Saves the image document to its original location if it has been changed. If there were no changes, the image document file will not be modified. Note that this may take a while and should not be called on the main thread.

Parameters
documentSaveOptions Save options for the document.
metadata If true image document will be saved to its original location together with the generated Pdf document in the metadata, when false Pdf in the metadata will be purged if any, and the saving will take effect persistently.
Returns
  • Single observable returning true if the file was modified and changes were saved. false if there was nothing to save.

public abstract Single<Boolean> saveIfModifiedAsync ()

Saves the image document to its original location if it has been changed. If there were no changes, the image document file will not be modified. Note that this may take a while and should not be called on the main thread.

Returns
  • Single observable returning true if the file was modified and changes were saved. false if there was nothing to save.