Class PdfLoadedBookmark
Represents the loaded bookmark class.
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public class PdfLoadedBookmark : PdfBookmark, IPdfWrapper, IEnumerable
Examples
//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
//Get all the bookmarks.
PdfBookmarkBase bookmarks = loadedDocument.Bookmarks;
//Get the first bookmark and set the properties of the bookmark.
PdfLoadedBookmark bookmark = bookmarks[0] as PdfLoadedBookmark;
bookmark.Destination = new PdfDestination(loadedDocument.Pages[1]);
bookmark.Color = Color.Green;
bookmark.TextStyle = PdfTextStyle.Bold;
bookmark.Title = "Changed title";
//Save the document
loadedDocument.Save("Output.pdf");
//Close the document
loadedDocument.Close(true);
'Load the PDF document.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
'Get all the bookmarks.
Dim bookmarks As PdfBookmarkBase = document.Bookmarks
'Get the first bookmark and set the properties of the bookmark.
Dim bookmark As PdfLoadedBookmark = TryCast(bookmarks(0), PdfLoadedBookmark)
bookmark.Destination = New PdfDestination(loadedDocument.Pages(1))
bookmark.Color = Color.Green
bookmark.TextStyle = PdfTextStyle.Bold
bookmark.Title = "Changed title"
'Save the document
loadedDocument.Save("Output.pdf")
'Close the document
loadedDocument.Close(True)
Properties
Color
Gets or sets the color of the bookmark title.
Declaration
public override PdfColor Color { get; set; }
Property Value
Type |
---|
PdfColor |
Overrides
Examples
//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
//Get all the bookmarks.
PdfBookmarkBase bookmarks = loadedDocument.Bookmarks;
//Get the first bookmark and set the properties of the bookmark.
PdfLoadedBookmark bookmark = bookmarks[0] as PdfLoadedBookmark;
bookmark.Destination = new PdfDestination(loadedDocument.Pages[1]);
bookmark.Color = Color.Green;
bookmark.TextStyle = PdfTextStyle.Bold;
bookmark.Title = "Changed title";
//Save the document
loadedDocument.Save("Output.pdf");
//Close the document
loadedDocument.Close(true);
'Load the PDF document.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
'Get all the bookmarks.
Dim bookmarks As PdfBookmarkBase = document.Bookmarks
'Get the first bookmark and set the properties of the bookmark.
Dim bookmark As PdfLoadedBookmark = TryCast(bookmarks(0), PdfLoadedBookmark)
bookmark.Destination = New PdfDestination(loadedDocument.Pages(1))
bookmark.Color = Color.Green
bookmark.TextStyle = PdfTextStyle.Bold
bookmark.Title = "Changed title"
'Save the document
loadedDocument.Save("Output.pdf")
'Close the document
loadedDocument.Close(True)
See Also
Destination
Gets or sets the outline destination.
Declaration
public override PdfDestination Destination { get; set; }
Property Value
Type | Description |
---|---|
PdfDestination | The PdfDestination object which is to be navigated. |
Overrides
Examples
//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get all the bookmarks.
PdfBookmarkBase bookmarks = loadedDocument.Bookmarks;
//Get the first bookmark
PdfLoadedBookmark bookmark = bookmarks[0] as PdfLoadedBookmark;
//Get the destination
PdfDestination dest = bookmark.Destination;
//Save and close the document
loadedDocument.Save("Output.pdf");
loadedDocument.Close(true);
'Load the PDF document.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
'Get all the bookmarks.
Dim bookmarks As PdfBookmarkBase = loadedDocument.Bookmarks
'get the bookmark count.
Dim count As Integer = bookmarks.Count
'Get the first bookmark
Dim bookmark As PdfLoadedBookmark = TryCast(bookmarks(0), PdfLoadedBookmark)
'Get the destination
Dim destination As PdfDestination = bookmark.Destination
'Save and close the document
loadedDocument.Save("Output.pdf")
loadedDocument.Close(True)
See Also
NamedDestination
Gets or sets the named destination for bookmarks.
Declaration
public override PdfNamedDestination NamedDestination { get; set; }
Property Value
Type | Description |
---|---|
PdfNamedDestination | The PdfNamedDestination object which is to be navigated. |
Overrides
Examples
//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get all the bookmarks.
PdfBookmarkBase bookmarks = loadedDocument.Bookmarks;
PdfNamedDestination destination = new PdfNamedDestination("TOC");
//Set the location
destination.Destination.Location = new PointF(0, 800);
//Set zoom factor to 400 percentage
destination.Destination.Zoom = 4;
//Add the named destination to the collection
loadedDocument.NamedDestinationCollection.Add(destination);
//Get the first bookmark
PdfLoadedBookmark bookmark = bookmarks[0] as PdfLoadedBookmark;
//Set the named destination to the bookmark.
bookmark.NamedDestination = destination;
//Save and close the document
loadedDocument.Save("Output.pdf");
loadedDocument.Close(true);
'Load the PDF document.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
'Get all the bookmarks.
Dim bookmarks As PdfBookmarkBase = loadedDocument.Bookmarks
Dim destination As PdfNamedDestination = New PdfNamedDestination("TOC")
destination.Destination = New PdfDestination(page)
'Set the location
destination.Destination.Location = New PointF(0, 800)
'Set zoom factor to 400 percentage
destination.Destination.Zoom = 4
Add the named destination to the collection
loadedDocument.NamedDestinationCollection.Add(destination)
'get the bookmark count.
Dim count As Integer = bookmarks.Count
'Get the first bookmark
Dim bookmark As PdfLoadedBookmark = TryCast(bookmarks(0), PdfLoadedBookmark)
'Set the named destination to the bookmark.
bookmark.NamedDestination = destination
'Save and close the document
loadedDocument.Save("Output.pdf")
loadedDocument.Close(True)
See Also
TextStyle
Gets or sets the style of the bookmark title.
Declaration
public override PdfTextStyle TextStyle { get; set; }
Property Value
Type | Description |
---|---|
PdfTextStyle | The PdfTextStyle enumeration value which selects the style of text for the bookmark title. |
Overrides
Examples
//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
//Get all the bookmarks.
PdfBookmarkBase bookmarks = loadedDocument.Bookmarks;
//Get the first bookmark and set the properties of the bookmark.
PdfLoadedBookmark bookmark = bookmarks[0] as PdfLoadedBookmark;
bookmark.Destination = new PdfDestination(loadedDocument.Pages[1]);
bookmark.Color = Color.Green;
bookmark.TextStyle = PdfTextStyle.Bold;
bookmark.Title = "Changed title";
//Save the document
loadedDocument.Save("Output.pdf");
//Close the document
loadedDocument.Close(true);
'Load the PDF document.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
'Get all the bookmarks.
Dim bookmarks As PdfBookmarkBase = document.Bookmarks
'Get the first bookmark and set the properties of the bookmark.
Dim bookmark As PdfLoadedBookmark = TryCast(bookmarks(0), PdfLoadedBookmark)
bookmark.Destination = New PdfDestination(loadedDocument.Pages(1))
bookmark.Color = Color.Green
bookmark.TextStyle = PdfTextStyle.Bold
bookmark.Title = "Changed title"
'Save the document
loadedDocument.Save("Output.pdf")
'Close the document
loadedDocument.Close(True)
See Also
Title
Gets or sets the outline title.
Declaration
public override string Title { get; set; }
Property Value
Type | Description |
---|---|
System.String | The string value which contains title of the bookmark. |
Overrides
Remarks
The outline title is the text, which appears in the outline tree as a tree node.
Examples
//Load the PDF document.
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("Input.pdf");
//Get all the bookmarks.
PdfBookmarkBase bookmarks = loadedDocument.Bookmarks;
//Get the first bookmark and set the properties of the bookmark.
PdfLoadedBookmark bookmark = bookmarks[0] as PdfLoadedBookmark;
bookmark.Destination = new PdfDestination(loadedDocument.Pages[1]);
bookmark.Color = Color.Green;
bookmark.TextStyle = PdfTextStyle.Bold;
bookmark.Title = "Changed title";
//Save the document
loadedDocument.Save("Output.pdf");
//Close the document
loadedDocument.Close(true);
'Load the PDF document.
Dim loadedDocument As New PdfLoadedDocument("Input.pdf")
'Get all the bookmarks.
Dim bookmarks As PdfBookmarkBase = document.Bookmarks
'Get the first bookmark and set the properties of the bookmark.
Dim bookmark As PdfLoadedBookmark = TryCast(bookmarks(0), PdfLoadedBookmark)
bookmark.Destination = New PdfDestination(loadedDocument.Pages(1))
bookmark.Color = Color.Green
bookmark.TextStyle = PdfTextStyle.Bold
bookmark.Title = "Changed title"
'Save the document
loadedDocument.Save("Output.pdf")
'Close the document
loadedDocument.Close(True)