DocumentConnection

This acts as a bridge between PdfFragment and DocumentView to access respective functionalities.

Properties

Link copied to clipboard

If this property is accessed before the UI is initialized an IllegalStateException will be thrown. Best practice is to wait until the onDocumentLoaded listener is triggered.

Link copied to clipboard
Link copied to clipboard
open val pdfUI: PdfUi
Link copied to clipboard
open val pdfUi: PdfUi

Access original (non-compose) SDK UI APIs from here.

Link copied to clipboard
abstract val showToolbarMenu: (Boolean) -> Unit

This function is used to show/hide overflow menu dropdown in toolbar

Functions

Link copied to clipboard
abstract fun addAnnotationToPage(annotation: Annotation, selectImmediately: Boolean)

Defers to PdfFragment.addAnnotationToPage(Annotation, Boolean)

Link copied to clipboard
abstract fun addDrawableProvider(highlighter: SearchResultHighlighter)

Defers to PdfFragment.addDrawableProvider()

Link copied to clipboard
abstract fun save(path: String? = null, options: DocumentSaveOptions? = null)

Saves the document to an external file even if it hasn't been changed. Note that this may take a while and should not be called on the main thread. This will not clear the {@link #wasModified()} flag on this document instance, and will not replace the source of this document either (i.e. subsequent calls to {@link #saveIfModified()} will still save the document back to the original file).

Link copied to clipboard
abstract fun setPageIndex(@IntRange(from = 0) pageIndex: Int)

Sets the page index in PdfFragment.pageIndex