onPageClick

open fun onPageClick(@NonNull document: PdfDocument, pageIndex: Int, @Nullable event: MotionEvent, @Nullable pagePosition: PointF, @Nullable clickedAnnotation: Annotation): Boolean

Called when user taps / clicks on the page.

Return

true if tap was handled by this DocumentListener and should not be handled by PSPDFKit anymore. If returning false PSPDFKit will continue executing it's default action.

Parameters

document

Currently opened document.

pageIndex

Page number of the page being tapped.

event

MotionEvent that triggered this page click. May be null if this page click was triggered from keyboard or accessibility event.

pagePosition

Tapped page position (in PDF page coordinates with origin on bottom left). Coordinates passed here may exceed the page size (which is returned by getPageSize) and can also be negative. If the click was triggered by the keyboard, pagePosition will be null.

clickedAnnotation

Annotation that was tapped, or null if no annotation was tapped.