DownloadJob

A task that can download a PDF document from a com.pspdfkit.document.download.source.DownloadSource. You can create and start a job using startDownload. To monitor the download progress you can either set a listener using setProgressListener or collect the progress.

Types

Link copied to clipboard
object Companion

Factory for creating and starting DownloadJobs.

Link copied to clipboard

Definition of callback objects for observing downloads. These callbacks are called on the main thread.

Link copied to clipboard

An empty implementation of a ProgressListener.

Properties

Link copied to clipboard

true if the download has been successfully completed.

Link copied to clipboard

The output file as defined by the started DownloadRequest.

Link copied to clipboard
val progress: Flow<Progress>

Returns a Flow emitting Progress events of the download. The latest progress is replayed to new collectors; the flow completes when the download finishes and throws the download error if it fails — always after the final progress event. Intermediate progress events may be conflated (latest wins).

Functions

Link copied to clipboard
fun cancel()

Cancel the running download. Listeners and progress collectors won't receive a completion event after calling this method (matching the previous RxJava behavior); collectors should be cancelled by their own scope.

Link copied to clipboard

Sets a ProgressListener for monitoring the download. Calling this method will replace any previously set listener. You may provide null to clear the listener.