menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfLoadedBookmark - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfLoadedBookmark

    Represents the loaded bookmark class.

    Inheritance
    System.Object
    PdfBookmarkBase
    PdfBookmark
    PdfLoadedBookmark
    Implements
    System.Collections.IEnumerable
    Inherited Members
    PdfBookmark.Action
    PdfBookmark.IsExpanded
    PdfBookmarkBase.Add(String)
    PdfBookmarkBase.Clear()
    PdfBookmarkBase.Contains(PdfBookmark)
    PdfBookmarkBase.Count
    PdfBookmarkBase.Insert(Int32, String)
    PdfBookmarkBase.Item[Int32]
    PdfBookmarkBase.Remove(String)
    PdfBookmarkBase.RemoveAt(Int32)
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Portable.dll
    Syntax
    public class PdfLoadedBookmark : PdfBookmark, IPdfWrapper, IEnumerable
    Examples

    This PdfLoadedBookmark class is used to load the bookmarks from the PDF document. Please refer the UG docuemntation link https://help.syncfusion.com/file-formats/pdf/working-with-bookmarks#modifying-the-bookmarks for more details.

    //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
    PdfBookmark.Color
    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
    PdfLoadedDocument
    PdfBookmarkBase

    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
    PdfBookmark.Destination
    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
    PdfLoadedDocument
    PdfBookmarkBase
    PdfDestination

    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
    PdfBookmark.NamedDestination
    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
    PdfLoadedDocument
    PdfBookmarkBase
    PdfNamedDestination

    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
    PdfBookmark.TextStyle
    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
    PdfLoadedDocument
    PdfBookmarkBase

    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
    PdfBookmark.Title
    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)
    See Also
    PdfLoadedDocument
    PdfBookmarkBase

    Implements

    System.Collections.IEnumerable

    See Also

    PdfLoadedDocument
    PdfBookmarkBase
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved