toViewRect

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

Converts the PDF coordinates stored in rect (of the given pageIndex) to view coordinates. 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

PDF coordinates.

pageIndex

Target page of the coordinates (0 denotes the first page).