toPdfRect

abstract fun toPdfRect(@NonNull rect: RectF, @IntRange(from = 0) pageIndex: Int)

Converts the view coordinates stored in rect to PDF coordinates on the given pageIndex. This method modifies rect in place.

This method throws an exception if called before the document has been laid out, or if a conversion for the given pageIndex is not possible (e.g. requested page number is invalid). See onDocumentLoaded which is called after the document has been loaded, and the document view has been laid out.

Parameters

rect

View coordinates.

pageIndex

Target page for the conversion (0 denotes the first page).