Skip to main content

ReadiumViewRef

Moves the reader, searches and zooms; get it with a ref on ReadiumView.

Example​

const ref = useRef<ReadiumViewRef>(null);
<ReadiumView ref={ref} file={file} />;
ref.current?.goForward();

Properties​

goTo​

goTo: (locator) => void;

Goes to a location: a chapter, a bookmark, a search result or one of the positions.

Parameters​

ParameterType
locatorLocator

Returns​

void


goForward​

goForward: () => void;

Goes to the next page.

Returns​

void


goBackward​

goBackward: () => void;

Goes to the previous page.

Returns​

void


search: (query, options?) => Promise<SearchPage>;

Starts a new search and resolves with the first page of results. Most apps should use useSearch instead.

Parameters​

ParameterType
querystring
options?SearchOptions

Returns​

Promise<SearchPage>

Platform​

iOS, Android. On web, resolves a page with isSupported: false.


loadMoreSearchResults​

loadMoreSearchResults: () => Promise<SearchPage>;

Resolves with the next page of results for the current search. Wait for each page before asking for the next: a search can't be advanced concurrently.

Returns​

Promise<SearchPage>


cancelSearch​

cancelSearch: () => void;

Cancels the current search and releases it.

Returns​

void


zoomIn​

zoomIn: () => void;

Magnifies a PDF one step.

Returns​

void


zoomOut​

zoomOut: () => void;

Reduces a PDF's magnification one step.

Returns​

void


setZoom​

setZoom: (scale) => void;

Sets a PDF's magnification, where 1 is the page fitted to the view.

Parameters​

ParameterType
scalenumber

Returns​

void


resetZoom​

resetZoom: () => void;

Fits the PDF's page to the view again.

Returns​

void