Example
Creating a bookmark for the 3rd page of a document.
const bookmark = new NutrientViewer.Bookmark({
name: 'test bookmark',
action: new NutrientViewer.Actions.GoToAction({ pageIndex: 3 })
});
instance.create(bookmark);
See Also
Hierarchy
Properties
The action that will be triggered when the bookmark is either clicked or tapped.
Please refer to NutrientViewer.Actions for an in-depth look at PDF actions.
A unique identifier to describe the bookmark. When a bookmark is created in the UI, the viewer has to generate a unique ID.
When changes are saved to the underlying bookmark provider, we call Instance#ensureChangesSaved to make sure the annotation has been persisted from the provider.
pdfBookmarkId
When the bookmark is extracted directly from a PDF file, the pdfBookmarkId refers to the
identifier that was used in the PDF document.
This ID is optional since newly created bookmarks using the SYNCProvider annotation provider
won't have a pdfBookmarkId assigned.
Default Value
nullMethods
fromSerializableObject
Bookmark deserializer. Converts a bookmark object to a NutrientViewer.Bookmark.
Parameters
bookmarkBookmarkJSONReturns
toSerializableObject
Bookmark serializer. Converts a bookmark to InstantJSON compliant objects.
Parameters
bookmarkNutrientViewer.BookmarkReturns
Immutable Record API
31
"[iterator]"(): IterableIterator<
[keyof { … }, string | number | NutrientViewer.Actions.Action | null],
>Returns
IterableIterator<
[keyof { … }, string | number | NutrientViewer.Actions.Action | null]
>
Returns
thisSee Also
Map#asImmutable
Returns
thisSee Also
Map#asMutable
Returns a new instance of this Record type with all values set to their default values.
Returns
this
delete<K extends keyof { … }>(key: K): this
Returns a new instance of this Record type with the value for the specific key set to its default value.
Parameters
otherunknownReturns
boolean
Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.
If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.
Parameters
keystringReturns
key is "id" | "name" | "action" | "pdfBookmarkId" | "sortKey"
Returns
number
Parameters
keyPathIterable<unknown>...collectionsunknown[]Returns
this
Parameters
keyPathIterable<unknown>...collectionsunknown[]Returns
this
remove<K extends keyof { … }>(key: K): this
Parameters
keyPathIterable<unknown>valueunknownReturns
this
Deeply converts this Record to equivalent native JavaScript Object.
Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.
Returns
{ … }
action: unknown
The action that will be triggered when the bookmark is either clicked or tapped.
Please refer to NutrientViewer.Actions for an in-depth look at PDF actions.
id: string | null
A unique identifier to describe the bookmark. When a bookmark is created in the UI, the viewer has to generate a unique ID.
When changes are saved to the underlying bookmark provider, we call Instance#ensureChangesSaved to make sure the annotation has been persisted from the provider.
name: string | null
optional
An optional name to associate to the bookmark.
Default Value
nullpdfBookmarkId: string | null
When the bookmark is extracted directly from a PDF file, the
pdfBookmarkIdrefers to the identifier that was used in the PDF document.This ID is optional since newly created bookmarks using the SYNCProvider annotation provider won't have a
pdfBookmarkIdassigned.Default Value
null
Shallowly converts this Record to equivalent native JavaScript Object.
Returns
{ … }
action: NutrientViewer.Actions.Action | null
The action that will be triggered when the bookmark is either clicked or tapped.
Please refer to NutrientViewer.Actions for an in-depth look at PDF actions.
id: string | null
A unique identifier to describe the bookmark. When a bookmark is created in the UI, the viewer has to generate a unique ID.
When changes are saved to the underlying bookmark provider, we call Instance#ensureChangesSaved to make sure the annotation has been persisted from the provider.
name: string | null
optional
An optional name to associate to the bookmark.
Default Value
nullpdfBookmarkId: string | null
When the bookmark is extracted directly from a PDF file, the
pdfBookmarkIdrefers to the identifier that was used in the PDF document.This ID is optional since newly created bookmarks using the SYNCProvider annotation provider won't have a
pdfBookmarkIdassigned.Default Value
null
Shallowly converts this Record to equivalent JavaScript Object.
Returns
{ … }
action: NutrientViewer.Actions.Action | null
The action that will be triggered when the bookmark is either clicked or tapped.
Please refer to NutrientViewer.Actions for an in-depth look at PDF actions.
id: string | null
A unique identifier to describe the bookmark. When a bookmark is created in the UI, the viewer has to generate a unique ID.
When changes are saved to the underlying bookmark provider, we call Instance#ensureChangesSaved to make sure the annotation has been persisted from the provider.
name: string | null
optional
An optional name to associate to the bookmark.
Default Value
nullpdfBookmarkId: string | null
When the bookmark is extracted directly from a PDF file, the
pdfBookmarkIdrefers to the identifier that was used in the PDF document.This ID is optional since newly created bookmarks using the SYNCProvider annotation provider won't have a
pdfBookmarkIdassigned.Default Value
null
toSeq(): Keyed<
keyof { … },
string
| number
| NutrientViewer.Actions.Action
| null,
>Returns
Keyed<keyof { … }, string | number | NutrientViewer.Actions.Action | null>
Parameters
keyPathIterable<unknown>updater(value: unknown) => unknownReturns
this
Returns
booleanSee Also
Map#wasAltered
Note: Not all methods can be used on a mutable collection or within
withMutations! Onlysetmay be used mutatively.Parameters
mutator(mutable: this) => unknownReturns
thisSee Also
Map#withMutations
This record is used to persist the information for a bookmark.
A bookmark is an object that registers a PDF action, usually triggered to go to a page.