File Formats

Code Examples Upgrade Guide User Guide Demos Support Forums Download
  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfBookmark

    Show / Hide Table of Contents

    Class PdfBookmark

    Each instance of this class represents an bookmark node in the bookmark tree.

    Inheritance
    System.Object
    PdfBookmarkBase
    PdfBookmark
    PdfLoadedBookmark
    Implements
    System.Collections.IEnumerable
    Inherited Members
    PdfBookmarkBase.Add(String)
    PdfBookmarkBase.Contains(PdfBookmark)
    PdfBookmarkBase.Remove(String)
    PdfBookmarkBase.RemoveAt(Int32)
    PdfBookmarkBase.Clear()
    PdfBookmarkBase.Insert(Int32, String)
    PdfBookmarkBase.IEnumerable.GetEnumerator()
    PdfBookmarkBase.Count
    PdfBookmarkBase.Item[Int32]
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfBookmark : PdfBookmarkBase, IPdfWrapper, IEnumerable
    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Set the destination page.
    bookmark.Destination = new PdfDestination(page);
    //Set the destination location.
    bookmark.Destination.Location = new PointF(20, 20);
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Set the destination page.
    bookmark.Destination = New PdfDestination(page)
    'Set the destination location.
    bookmark.Destination.Location = New PointF(20, 20)
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)

    Properties

    Action

    Declaration
    public PdfAction Action { get; set; }
    Property Value
    Type Description
    PdfAction

    Color

    Declaration
    public virtual PdfColor Color { get; set; }
    Property Value
    Type Description
    PdfColor

    Destination

    Declaration
    public virtual PdfDestination Destination { get; set; }
    Property Value
    Type Description
    PdfDestination

    IsExpanded

    Gets or sets the whether to expand the node or not.

    Declaration
    public bool IsExpanded { get; set; }
    Property Value
    Type Description
    System.Boolean

    true If the bookmark is expanable , otherwise false.

    Examples
    //Create a new document.
    PdfDocument Document = new PdfDocument();
    //Add a page.
    PdfPage page = Document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = Document.Bookmarks.Add("page1");
    //Set color.
    bookmark.Color = Color.Red;
    bool expand = bookmark.IsExpanded;
    //Create a Uri action
    PdfUriAction uriAction = new PdfUriAction("http://www.google.com");
    //Set the Uri action
    bookmark.Action = uriAction;
    //Save and close the PDF document.
    Document.Save("Output.pdf");
    Document.Close(true);
    'Create a new document.
    Dim Document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = Document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = Document.Bookmarks.Add("page1")
    'Set color.
    bookmark.Color = Color.Red
    bool expand = bookmark.IsExpanded
    'Create a Uri action
    Dim uriAction As New PdfUriAction("http://www.google.com")
    'Set the Uri action
    bookmark.Action = uriAction
    'Save and close the PDF document.
    Document.Save("Output.pdf")
    Document.Close(True)
    See Also
    PdfDocument
    PdfPage

    NamedDestination

    Declaration
    public virtual PdfNamedDestination NamedDestination { get; set; }
    Property Value
    Type Description
    PdfNamedDestination

    TextStyle

    Declaration
    public virtual PdfTextStyle TextStyle { get; set; }
    Property Value
    Type Description
    PdfTextStyle

    Title

    Gets or sets the outline title.

    Declaration
    public virtual string Title { get; set; }
    Property Value
    Type Description
    System.String

    A string value which contains the bookmark title

    Remarks

    The outline title is the text, which appears in the outline tree as a tree node.

    Examples
    //Create a new document.
    PdfDocument document = new PdfDocument();
    //Add a page.
    PdfPage page = document.Pages.Add();
    //Create document bookmarks.
    PdfBookmark bookmark = document.Bookmarks.Add("Page 1");
    //Set the destination page.
    bookmark.Destination = new PdfDestination(page);
    //Set the destination location.
    bookmark.Destination.Location = new PointF(20, 20);
    //Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold;
    bookmark.Color = Color.Red;
    //Set the Bookmark Title.
    bookmark.Title = "Bookmark";
    //Save and close the PDF document.
    document.Save("Output.pdf");
    document.Close(true);
    'Create a new document.
    Dim document As New PdfDocument()
    'Add a page.
    Dim page As PdfPage = document.Pages.Add()
    'Create document bookmarks.
    Dim bookmark As PdfBookmark = document.Bookmarks.Add("Page 1")
    'Set the destination page.
    bookmark.Destination = New PdfDestination(page)
    'Set the destination location.
    bookmark.Destination.Location = New PointF(20, 20)
    'Set the text style and color.
    bookmark.TextStyle = PdfTextStyle.Bold
    bookmark.Color = Color.Red
    'Set the bookmark title.
    bookmark.Title = "Bookmark"
    'Save and close the PDF document.
    document.Save("Output.pdf")
    document.Close(True)
    See Also
    PdfDocument
    PdfPage

    Implements

    System.Collections.IEnumerable

    See Also

    PdfPage
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved