Class ImageDocumentLoader
-
- All Implemented Interfaces:
public final class ImageDocumentLoader
Helper class for loading ImageDocument from a DocumentSource.
-
-
Constructor Summary
Constructors Constructor Description ImageDocumentLoader()
-
Method Summary
Modifier and Type Method Description static ImageDocument
openDocument(@NonNull() Context context, @NonNull() Uri documentUri)
Opens an image document from a Uri. static Single<ImageDocument>
openDocumentAsync(@NonNull() Context context, @NonNull() Uri documentUri)
Opens an image document from a Uri. static ImageDocument
openDocument(@NonNull() Context context, @NonNull() DocumentSource source)
Opens an image document from a Uri. static Single<ImageDocument>
openDocumentAsync(@NonNull() Context context, @NonNull() DocumentSource source)
Opens an image document from a Uri. static PdfConfiguration
getDefaultImageDocumentConfiguration()
Returns default configuration for image documents. static PdfConfiguration
getDefaultImageDocumentConfiguration(@NonNull() PdfConfiguration configuration)
Returns default configuration for image documents from a given initial configuration. static PdfActivityConfiguration
getDefaultImageDocumentActivityConfiguration(@NonNull() Context context)
Returns default activity configuration for image documents. static PdfActivityConfiguration
getDefaultImageDocumentActivityConfiguration(@NonNull() PdfActivityConfiguration configuration)
Returns default activity configuration for image documents from a given initial configuration. -
-
Method Detail
-
openDocument
@NonNull() static ImageDocument openDocument(@NonNull() Context context, @NonNull() Uri documentUri)
Opens an image document from a Uri. Note that currently only local files are supported and passing remote or non-file Uris will throw an java.io.IOException.
Note that this method blocks until the image document is loaded and should not be invoked on main thread.
- Parameters:
context
- Application context.documentUri
- Uri pointing to the PDF document.- Returns:
ImageDocument instance if the opening succeeded.
-
openDocumentAsync
@NonNull() static Single<ImageDocument> openDocumentAsync(@NonNull() Context context, @NonNull() Uri documentUri)
Opens an image document from a Uri. Note that currently only local files are supported and passing remote or non-file Uris will throw an java.io.IOException.
- Parameters:
context
- Application context.documentUri
- Uri pointing to the PDF document.- Returns:
Single observable returning an ImageDocument instance if the opening succeeded.
-
openDocument
@NonNull() static ImageDocument openDocument(@NonNull() Context context, @NonNull() DocumentSource source)
Opens an image document from a Uri. Note that currently only local files are supported and passing remote or non-file Uris will throw an java.io.IOException.
Note that this method blocks until the image document is loaded and should not be invoked on main thread.
- Parameters:
context
- Application context.source
- DocumentSource describing the source of the image document.- Returns:
ImageDocument instance if the opening succeeded.
-
openDocumentAsync
@NonNull() static Single<ImageDocument> openDocumentAsync(@NonNull() Context context, @NonNull() DocumentSource source)
Opens an image document from a Uri. Note that currently only local files are supported and passing remote or non-file Uris will throw an java.io.IOException.
- Parameters:
context
- Application context.source
- DocumentSource describing the source of the image document.- Returns:
Single observable returning an ImageDocument instance if the opening succeeded.
-
getDefaultImageDocumentConfiguration
@NonNull() static PdfConfiguration getDefaultImageDocumentConfiguration()
Returns default configuration for image documents.
- Returns:
Default configuration specifically thought for image documents (e.g. for a better user experience layout mode is set to single and fit mode is set to the screen dimension).
-
getDefaultImageDocumentConfiguration
@NonNull() static PdfConfiguration getDefaultImageDocumentConfiguration(@NonNull() PdfConfiguration configuration)
Returns default configuration for image documents from a given initial configuration. For a better user experience, layout mode will be set to SINGLE and fit mode will be set to FIT_TO_SCREEN.
- Parameters:
configuration
- Given configuration which will be tailored with better options specific for image documents.- Returns:
Default configuration specifically thought for image documents (e.g. for a better user experience layout mode is set to single and fit mode is set to the screen dimension).
-
getDefaultImageDocumentActivityConfiguration
@NonNull() static PdfActivityConfiguration getDefaultImageDocumentActivityConfiguration(@NonNull() Context context)
Returns default activity configuration for image documents.
- Returns:
Default activity configuration specifically thought for image documents (e.g. for a better user experience thumbnail bar and page number overlay are hidden).
-
getDefaultImageDocumentActivityConfiguration
@NonNull() static PdfActivityConfiguration getDefaultImageDocumentActivityConfiguration(@NonNull() PdfActivityConfiguration configuration)
Returns default activity configuration for image documents from a given initial configuration. For a better user experience, thumbnail bar and page number overlay will be hidden, layout mode will be set to SINGLE and fit mode will be set to FIT_TO_SCREEN.
- Parameters:
configuration
- Given configuration which will be tailored with better options specific for image documents.- Returns:
Default activity configuration specifically thought for image documents (e.g. for a better user experience thumbnail bar and page number overlay are hidden).
-
-
-
-