Colibrio Reader Framework API - Cloud license
    Preparing search index...

    Interface IPageProgressionTimeline

    Describes the contents in the ReaderView as a one-dimensional timeline of all renderable pages.

    Positions in the timeline consist of a page index and an offset within that page as a value between 0 and 1. The page index of the first page in the timeline is 0. The timeline length and the page positions can be fixed or estimated depending on the publication and the pageProgressionTimelineOptions ReaderView option.

    You can determine if the page numbers are fixed or estimated using IPageProgressionTimeline.getTimelineType(). Please see PageProgressionTimelineType documentation for more information.

    You can listen on the EngineEvent 'pageProgressionTimelineVisibleRangeChanged' to react to changes in the timeline.

    For most use-cases, the IContentPositionTimeline is preferred over the IPageProgressionTimeline to measure reading progress due to its more deterministic nature.

    interface IPageProgressionTimeline {
        fetchLocatorFromPageIndex(
            pageIndex: number,
            snapToFirstPageIfSpread?: boolean,
        ): Promise<Locator>;
        fetchLocatorFromPosition(
            position: IPageProgressionTimelinePositionData,
            snapToFirstPageIfSpread?: boolean,
        ): Promise<Locator>;
        fetchPositionFromLocator(
            locator:
                | ILocator
                | ILocatorData
                | IReaderPublicationNavigationItemData
                | IReaderPublicationNavigationItem
                | IUnresolvedContentLocation,
        ): Promise<IPageProgressionTimelinePositionData>;
        getTimelineType(): PageProgressionTimelineType;
        getTotalNumberOfPages(): number;
        getVisibleTimelineRange(): IPageProgressionTimelineRangeData;
        toJSON(): IPageProgressionTimelineData;
    }

    Methods

    • Fetch a locator from a zero-based page index. The passed page index will be clamped between the timeline start and end.

      Parameters

      • pageIndex: number

        The zero-based page index.

      • OptionalsnapToFirstPageIfSpread: boolean

        If set to true, the locator will point to the first page of a spread. Has no effect on non-spread renderers.

      Returns Promise<Locator>

    • Fetch a locator from a timeline position. The passed position will be clamped between the timeline start and end position.

      Parameters

      • position: IPageProgressionTimelinePositionData

        The position from which to fetch a locator.

      • OptionalsnapToFirstPageIfSpread: boolean

        If set to true, the locator will point to the first page of a spread. Has no effect on non-spread renderers.

      Returns Promise<Locator>

    • Get the total number of pages for all of the reader documents inside the ReaderView. Use getTimelineType() to determine if this value is estimated or fixed.

      Returns number