PdfView.OnViewportChangedListener


interface PdfView.OnViewportChangedListener


Listener interface to receive changes to the viewport, i.e. the window of visible PDF content

Summary

Public functions

Unit
onViewportChanged(
    firstVisiblePage: Int,
    visiblePagesCount: Int,
    pageLocations: SparseArray<RectF>,
    zoomLevel: Float
)

Called when there has been a change in visible PDF content

Public functions

onViewportChanged

Added in 1.0.0-alpha10
fun onViewportChanged(
    firstVisiblePage: Int,
    visiblePagesCount: Int,
    pageLocations: SparseArray<RectF>,
    zoomLevel: Float
): Unit

Called when there has been a change in visible PDF content

Parameters
firstVisiblePage: Int

the first page that's visible in the View, even if partially so

visiblePagesCount: Int

the number of pages that are visible in the View, including partially visible pages

pageLocations: SparseArray<RectF>

the location of each page in View coordinates. At extremely low zoom levels, only the first 100 page locations will be provided, and the rest can be obtained from pdfToViewPoint. Rect instances are recycled; make a copy of any you wish to make use of beyond the scope of this method.

zoomLevel: Float

the current zoom level