fetchRectsForVisibleContent

abstract fun fetchRectsForVisibleContent(locator: SimpleLocatorData? = null, options: VisibleContentRectsOptions = VisibleContentRectsOptions(), onSuccess: (VisibleContentRectsResultData) -> Unit, onError: (ColibrioException) -> Unit)
abstract suspend fun fetchRectsForVisibleContent(locator: SimpleLocatorData? = null, options: VisibleContentRectsOptions = VisibleContentRectsOptions()): ColibrioResult<VisibleContentRectsResultData>

Fetch rectangles and locators for line boxes and replaced elements such as <img> elements from this visible page. If a locator is specified, it will be used to filter the result.

The rectangle coordinates are in device independent pixels where (0, 0) is top left of the ColibrioReadingSystemView. This means that any subsequent transform applied to the ReaderView, such as the user pinch-zooming, will make those rectangles out of date.

The rects are ordered in document order.

If the visible page is currently not in ReaderView.visiblePages , the returned result is rejected with an error object with the error type set to VISIBLE_PAGE_OUTDATED.

If the visible page is destroyed before the result could be calculated, the returned result is rejected with an error object with the error type set to ABORTED.

If the passed locator is not intersecting with the visible page, the returned result is rejected with an error object with the error type set to CONTENT_LOCATION_OUTSIDE_VISIBLE_PAGE.