How can I help you?
PdfBookmarkBase
6 Feb 20264 minutes to read
Represents a base class for all bookmark objects.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get bookmarks
let bookmarks: PdfBookmarkBase = document.bookmarks;
// Destroy the document
document.destroy();Properties
Get count number
Gets the bookmark count (Read only).
Get isExpanded boolean
Gets the boolean flag indicating whether the bookmark is expanded or not.
Set isExpanded void
Sets the boolean flag indicating whether the bookmark is expanded or not.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Whether the bookmark is expanded or not. |
Methods
add
Creates and adds a new outline to the PDF document.
| Parameter | Type | Description |
|---|---|---|
| title | string |
The title of the outline. |
Returns PdfBookmark
add
Adds a new outline (bookmark) with title and optional properties to the PDF document .
Returns PdfBookmark
add
Insert a new outline to the PDF document at specified index.
| Parameter | Type | Description |
|---|---|---|
| title | string |
The title of the outline. |
| index | number |
The index to insert. |
Returns PdfBookmark
add
Adds a new outline (bookmark) to the PDF document.
Returns PdfBookmark
at
Gets the PdfBookmark at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | number |
Bookmark index. |
Returns PdfBookmark
clear
Removes all the bookmark from the collection.
Returns void
contains
Gets the boolean flag indicating whether PdfBookmark is present or not.
| Parameter | Type | Description |
|---|---|---|
| outline | PdfBookmark |
Bookmark. |
Returns boolean
remove
Remove specified bookmark from the document.
| Parameter | Type | Description |
|---|---|---|
| title | string |
The title of the outline.typescript<br>// Load an existing PDF document<br>let document: PdfDocument = new PdfDocument(data, password);<br>// Access the first page of the PDF<br>let page: PdfPage = document.getPage(0);<br>// Get the bookmarks<br>let bookmarks: PdfBookmarkBase = document.bookmarks;<br>// Remove specified bookmark from the document.<br>bookmarks.remove('Introduction');<br>// Sets destination to the bookmark<br>bookmark.destination = new PdfDestination(page, {x: 10, 10});<br>// Destroy the document<br>document.destroy();<br> |
Returns void
remove
Remove the bookmark from the document at the specified index.
| Parameter | Type | Description |
|---|---|---|
| index | number |
The index.typescript<br>// Load an existing PDF document<br>let document: PdfDocument = new PdfDocument(data, password);<br>// Access the first page of the PDF<br>let page: PdfPage = document.getPage(0);<br>// Get the bookmarks<br>let bookmarks: PdfBookmarkBase = document.bookmarks;<br>// Remove the bookmark from the document at the index 1.<br>bookmarks.remove(1);<br>// Sets destination to the bookmark<br>bookmark.destination = new PdfDestination(page, {x: 10, 10});<br>// Destroy the document<br>document.destroy();<br> |
Returns void