Interface ImageDocument
-
- All Implemented Interfaces:
public interface ImageDocument
An image document. To create an instance use openDocument or openDocument or related static async methods.
-
-
Method Summary
Modifier and Type Method Description 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
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 boolean
saveIfModified(@NonNull() 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. abstract Single<Boolean>
saveIfModifiedAsync(boolean metadata)
Saves the image document to its original location if it has been changed. abstract Single<Boolean>
saveIfModifiedAsync(@NonNull() DocumentSaveOptions documentSaveOptions, boolean metadata)
Saves the image document to its original location if it has been changed. abstract boolean
isValidForEditing()
Returns true
if the document is editable (comes from a file URI or from another source that supports writing),false
otherwise.-
-
Method Detail
-
getDocument
@Nullable() abstract PdfDocument getDocument()
Gets the converted Pdf document.
- Returns:
Pdf document converted from image document.
-
getImageDocumentSource
@NonNull() abstract DocumentSource getImageDocumentSource()
Returns the image document source which may be a DataProvider or a file Uri.
- Returns:
The image document source.
-
saveIfModified
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.
-
saveIfModified
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
- Iftrue
image document will be saved to its original location together with the generated Pdf document in the metadata, whenfalse
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.
-
saveIfModified
abstract boolean saveIfModified(@NonNull() 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
- Iftrue
image document will be saved to its original location together with the generated Pdf document in the metadata, whenfalse
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.
-
saveIfModifiedAsync
@NonNull() 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.
-
saveIfModifiedAsync
@NonNull() 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
- Iftrue
image document will be saved to its original location together with the generated Pdf document in the metadata, whenfalse
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.
-
saveIfModifiedAsync
@NonNull() abstract Single<Boolean> saveIfModifiedAsync(@NonNull() 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
- Iftrue
image document will be saved to its original location together with the generated Pdf document in the metadata, whenfalse
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.
-
isValidForEditing
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.
-
-
-
-