Bookmark

Represents a bookmark.

public class Bookmark
Public Class Bookmark

Inheritance: ObjectBookmark

Licensing Info

This class is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:

Examples

The following example will get a bookmark from the child bookmark list.

Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private MyPdfViewer As PdfViewer

    Sub New()
        InitializeComponent()
    End Sub

    Private Sub InitializeComponent()
        Me.MyPdfViewer = New PdfViewer()
        Me.Controls.Add(MyPdfViewer)
    End Sub

    Shared Sub Main()
        Application.Run(New Form1())
    End Sub			
    
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs) Handles MyBase.Load
        Dim MyDocument As PdfDocument = New PdfDocument("C:\MyDocument.pdf")

        ' Get the bookmark list from PDF document object.
        Dim MyBookmarksList As BookmarkList = MyDocument.Bookmarks
        
        ' Get a single bookmark from the list by specifying the index between 0 and count of bookmarks.
        Dim MyBookmark As Bookmark = MyBookmarksList(1) 
        
        ' Open the document in Viewer.
        MyPdfViewer.Open(MyDocument)

        ' Navigate to the selected bookmark.
        MyPdfViewer.Navigate(MyBookmark)
    End Sub

End Class        
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;

namespace DynamicPDFViewerDemo
{
    public class Form1 : System.Windows.Forms.Form
    {
        private PdfViewer pdfViewer;

        public Form1()
        {
            InitializeComponent();
            this.Load+=new EventHandler(Form1_Load);
        }

        private void InitializeComponent()
        {
            this.pdfViewer = new PdfViewer();
            this.Controls.Add(pdfViewer);
        }

        [STAThread]
        static void Main()
        {
            Application.Run(new Form1());
        }			

        private void Form1_Load(object sender, EventArgs e)
        {
            PdfDocument document = new PdfDocument(@"C:\MyDocument.pdf");

            // Get the bookmark list from PDF document object.
            BookmarkList bookmarksList = document.Bookmarks;
            
            // Get a single bookmark from the list by specifying the index between 0 and count of bookmarks.
            Bookmark bookmark = bookmarksList[2];

            // Open the document in Viewer.
            pdfViewer.Open(document);

            // Navigate to the selected bookmark.
            pdfViewer.Navigate(bookmark);			
        }
    }
}

Properties

BookmarksGets the collection of child bookmarks present in the document.
PageNumberGet the page number to which the bookmark will navigate.
TextGets the text of the bookmark.

Methods

Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.Viewer

In this topic