Skip to main content

ReadiumProps

The props of ReadiumView.

Properties​

file​

file: ReadiumFile;

The publication to open, and where to start. Setting a different url opens that publication in the same view.


preferences?​

optional preferences?: Preferences;

How the reader lays out and styles the publication: theme, font size, margins, …. Readium's defaults apply to anything left out. Check capabilities for what applies.


decorations?​

optional decorations?: DecorationGroup[];

Highlights and underlines to render, in named groups.


selectionActions?​

optional selectionActions?: SelectionAction[];

Items added to the text-selection menu; picking one fires onSelectionAction.


style?​

optional style?: any;

The view's style.


onLocationChange?​

optional onLocationChange?: (locator) => void;

The reading position changed, e.g. the user turned a page. Save it to reopen there.

Parameters​

ParameterType
locatorLocator

Returns​

void


onPublicationReady?​

optional onPublicationReady?: (event) => void;

The publication opened: its metadata, table of contents, positions and capabilities.

Parameters​

ParameterType
eventPublicationReadyEvent

Returns​

void


onPreferencesChanged?​

optional onPreferencesChanged?: (event) => void;

Preferences were applied; reports which ones now apply.

Parameters​

ParameterType
eventPreferencesChangedEvent

Returns​

void


onPublicationError?​

optional onPublicationError?: (event) => void;

The publication couldn't be opened; code says why. Fires instead of onPublicationReady.

Parameters​

ParameterType
eventPublicationErrorEvent

Returns​

void


onDecorationActivated?​

optional onDecorationActivated?: (event) => void;

The user tapped a decoration, e.g. a highlight.

Parameters​

ParameterType
eventDecorationActivatedEvent

Returns​

void


onSelectionChange?​

optional onSelectionChange?: (event) => void;

The text selection changed, as the user adjusts it.

Parameters​

ParameterType
eventSelectionEvent

Returns​

void


onSelectionAction?​

optional onSelectionAction?: (event) => void;

The user picked one of the selectionActions.

Parameters​

ParameterType
eventSelectionActionEvent

Returns​

void


onZoomChange?​

optional onZoomChange?: (event) => void;

A PDF's magnification changed, including by a pinch.

Parameters​

ParameterType
eventZoomEvent

Returns​

void

Platform​

web. The native PDF viewers zoom by themselves and report nothing.