PdfDrawableProvider

Interface for a class that can return a list of PdfDrawable instances that should be drawn on top of the document.

See also

PdfDrawableManager.addDrawableProvider
PdfDrawableManager.removeDrawableProvider

Inheritors

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard

An observer interested in changes to the underlying set of drawables.

Functions

Link copied to clipboard
abstract suspend fun getDrawablesForPage(context: Context, document: PdfDocument, @IntRange(from = 0) pageIndex: Int): List<ERROR CLASS: Symbol not found for PdfDrawable>?

Returns all drawables for the given document and pageIndex. The framework may call this method on any thread.

Link copied to clipboard
open override fun getFilteredPages(): Set<Int>

By overriding this method subclasses can define a set of page numbers for which drawables are available. The default implementation returns an empty set, which will cause PSPDFKit to ask the provider every time page drawables are required, independent of the page number. Consider overriding this method if the loaded document has many pages, but only a few of them contain drawables.

Link copied to clipboard

Notifies all registered DrawableProviderObserver instances that the drawables have changed and need to be reloaded and redrawn. If only drawables for a single page have changed, consider calling notifyDrawablesChanged instead.

fun notifyDrawablesChanged(@IntRange(from = 0) pageIndex: Int)

Notifies all registered DrawableProviderObserver instances that the drawables for the given pageIndex have changed and need to be reloaded and redrawn.

Link copied to clipboard

Register a DrawableProviderObserver to be notified of changes of provided drawables. If the observer has been registered previously, a call to this method is a no-op.

Link copied to clipboard

Unregister a previously registered DrawableProviderObserver so it won't receive any future changes of provided drawables.