Represents a bookmark.

For a list of all members of this type, see Bookmark Members


System.Object
   ceTe.DynamicPDF.PageElement
public class Bookmark : PageElement 

Remarks

This class can be used to place bookmarks on the PDF document. These bookmarks will be displayed to the right of the PDF document. See the Outlines and Bookmarks topic for more details on bookmarks.

Example

The following example will place three bookmarks on the PDF document. Each bookmark has a different action. The first bookmark links to a URL and when clicked on will open up that URL in the current window. The second bookmark when clicked will zoom the page to fit the width of that page. The third bookmark when clicked will bring the specified X, Y destination into focus. If that destination location is already visible no action is taken.

[Visual Basic]
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements

Module MyModule
        
    Sub Main()
        
        ' Create a PDF Document
        Dim MyDocument As Document = New Document
        
        ' Create three page objects
        Dim MyPage1 As Page = New Page(PageSize.Letter)
        Dim MyPage2 As Page = New Page(PageSize.Letter)
        Dim MyPage3 As Page = New Page(PageSize.Letter)
        
        ' Add a top level Outline
        Dim MyParentOutline As Outline = MyDocument.Outlines.Add("Parent Outline")
        
        ' Add a top level bookmark
        MyPage1.Elements.Add(New Bookmark("Top level bookmark to page 1", 0, 0))
        
        ' Add child bookmarks
        MyPage1.Elements.Add(New Bookmark("Bookmark to page 1", 0, 0, MyParentOutline))
        MyPage2.Elements.Add(New Bookmark("Bookmark to page 2", 0, 0, MyParentOutline))
        MyPage3.Elements.Add(New Bookmark("Bookmark to page 3", 0, 0, MyParentOutline))
        
        ' Add the three pages to the document
        MyDocument.Pages.Add(MyPage1)
        MyDocument.Pages.Add(MyPage2)
        MyDocument.Pages.Add(MyPage3)
        
        ' Save the PDF document
        MyDocument.Draw("C:\MyDocument.pdf")
        
    End Sub
End Module
[C#]
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

class MyClass
{
    static void Main()
    {
        // Create a PDF Document
        Document document = new Document();
        
        // Create three page objects
        Page page1 = new Page( PageSize.Letter );
        Page page2 = new Page( PageSize.Letter );
        Page page3 = new Page( PageSize.Letter );
        
        // Add a top level Outline
        Outline parentOutline = document.Outlines.Add( "Parent Outline" );
        
        // Add a top level bookmark
        page1.Elements.Add( new Bookmark( "Top level bookmark to page 1", 0, 0 ) );
        
        // Add child bookmarks
        page1.Elements.Add( new Bookmark( "Bookmark to page 1", 0, 0, parentOutline ) );
        page2.Elements.Add( new Bookmark( "Bookmark to page 2", 0, 0, parentOutline ) );
        page3.Elements.Add( new Bookmark( "Bookmark to page 3", 0, 0, parentOutline ) );
        
        // Add the three pages to the document
        document.Pages.Add( page1 );
        document.Pages.Add( page2 );
        document.Pages.Add( page3 );
        
        // Save the PDF document
        document.Draw( @"C:\MyDocument.pdf" );
    }
}

Requirements

Namespace: ceTe.DynamicPDF.PageElements Namespace

Assembly: DynamicPDF.Generator.[Edition].dll

See Also

Bookmark members | ceTe.DynamicPDF.PageElements Namespace