openDocuments

open fun openDocuments(@NonNull context: Context, @NonNull @Size(min = 1) sources: List<DocumentSource>): PdfDocument

Opens multiple PDF document from a list of sources. The documents will be displayed as a single continuous document. Remote Uri's are supported and automatically downloaded.

Note that this method blocks until the document is loaded and should not be invoked on main thread. If you're passing a remote Uri and run this method on the main thread, it will throw an DownloadException.DownloadOnMainThreadException.

Return

PdfDocument instance if the opening succeeded.

Parameters

context

Application context.

sources

List of DocumentSources describing the sources and passwords of the documents.

Throws

If file was not opened correctly.

If no passwords or a wrong passwords were provided for opening the documents.

If PSPDFKit was not initialized with initialize call.

If trying to open a remote Uri on the main thread

If anything happened during the download of a remote Uri


open fun openDocuments(@NonNull context: Context, @NonNull @Size(min = 1) sources: List<DocumentSource>, multithreadedRenderingEnabled: Boolean): PdfDocument

Opens multiple PDF document from a list of sources. The documents will be displayed as a single continuous document. Remote Uri's are supported and automatically downloaded.

Note that this method blocks until the document is loaded and should not be invoked on main thread. If you're passing a remote Uri and run this method on the main thread, it will throw an DownloadException.DownloadOnMainThreadException.

Return

PdfDocument instance if the opening succeeded.

Parameters

context

Application context.

sources

List of DocumentSources describing the sources and passwords of the documents.

multithreadedRenderingEnabled

Whether the multithreaded rendering should be enabled when rendering document pages.

Throws

If file was not opened correctly.

If no passwords or a wrong passwords were provided for opening the documents.

If PSPDFKit was not initialized with initialize call.

If trying to open a remote Uri on the main thread

If anything happened during the download of a remote Uri