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
| Parameter | Type |
|---|---|
locator | Locator |
Returns
void
onPublicationReady?
optional onPublicationReady?: (event) => void;
The publication opened: its metadata, table of contents, positions and capabilities.
Parameters
| Parameter | Type |
|---|---|
event | PublicationReadyEvent |
Returns
void
onPreferencesChanged?
optional onPreferencesChanged?: (event) => void;
Preferences were applied; reports which ones now apply.
Parameters
| Parameter | Type |
|---|---|
event | PreferencesChangedEvent |
Returns
void
onPublicationError?
optional onPublicationError?: (event) => void;
The publication couldn't be opened; code says why. Fires instead of onPublicationReady.
Parameters
| Parameter | Type |
|---|---|
event | PublicationErrorEvent |
Returns
void
onDecorationActivated?
optional onDecorationActivated?: (event) => void;
The user tapped a decoration, e.g. a highlight.
Parameters
| Parameter | Type |
|---|---|
event | DecorationActivatedEvent |
Returns
void
onSelectionChange?
optional onSelectionChange?: (event) => void;
The text selection changed, as the user adjusts it.
Parameters
| Parameter | Type |
|---|---|
event | SelectionEvent |
Returns
void
onSelectionAction?
optional onSelectionAction?: (event) => void;
The user picked one of the selectionActions.
Parameters
| Parameter | Type |
|---|---|
event | SelectionActionEvent |
Returns
void
onZoomChange?
optional onZoomChange?: (event) => void;
A PDF's magnification changed, including by a pinch.
Parameters
| Parameter | Type |
|---|---|
event | ZoomEvent |
Returns
void
Platform
web. The native PDF viewers zoom by themselves and report nothing.