toPdfPoint

abstract fun toPdfPoint(@NonNull point: PointF, @IntRange(from = 0) pageIndex: Int)

Converts the coordinates stored within point from the view coordinate space (i.e. screen pixels) to PDF coordinate space of the given pageIndex. This method modifies point 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

point

Point containing view coordinates (pixels) that should be converted to PDF coordinates.

pageIndex

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