fetchRectsForVisibleContent

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

Fetch rectangles and locators for line boxes and replaced elements such as <img> elements from the specified 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 passed visiblePage is not currently part of the array returned by visiblePages, the returned result is rejected with an error object with the error type set to VISIBLE_PAGE_OUTDATED.

If the passed visiblePage 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 contentLocation is not intersecting with the visiblePage, the returned result is rejected with an error object with the error type set to CONTENT_LOCATION_OUTSIDE_VISIBLE_PAGE.