DownloadOnMainThreadException

Thrown if you try to open a remote document/image with any of the com.pspdfkit.document.PdfDocumentLoader or com.pspdfkit.document.ImageDocumentLoader open methods on the main thread. To open a remote document off the main thread, call the suspend openDocumentAsync(...) from a coroutine (it offloads its work to a background dispatcher), e.g.:

val document = PdfDocumentLoader.openDocumentAsync(context, uri)

Constructors

Link copied to clipboard
constructor()