onDocumentLongPress

abstract fun onDocumentLongPress(@NonNull document: PdfDocument, @IntRange(from = 0) pageIndex: Int, @Nullable event: MotionEvent, @Nullable pagePosition: PointF, @Nullable longPressedAnnotation: Annotation): Boolean

Called when user long-press / long-clicks on the page.

Return

true if tap was handled by this OnDocumentLongPressListener 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 long-pressed.

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.

longPressedAnnotation

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