Class PdfLoadedBookmark
- Namespace
- Syncfusion.Pdf.Interactive
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents the loaded bookmark class.
public class PdfLoadedBookmark : PdfBookmark, IEnumerable
- Inheritance
-
PdfLoadedBookmark
- Implements
- Inherited Members
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.
public override PdfColor Color { get; set; }
Property Value
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.
public override PdfDestination Destination { get; set; }
Property Value
- PdfDestination
The PdfDestination object which is to be navigated.
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.
public override PdfNamedDestination NamedDestination { get; set; }
Property Value
- PdfNamedDestination
The PdfNamedDestination object which is to be navigated.
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.
public override PdfTextStyle TextStyle { get; set; }
Property Value
- PdfTextStyle
The PdfTextStyle enumeration value which selects the style of text for the bookmark title.
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.
public override string Title { get; set; }
Property Value
- string
The string value which contains title of the bookmark.
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)
Remarks
The outline title is the text, which appears in the outline tree as a tree node.
- See Also