Bookmark

Represents a bookmark.

public class Bookmark : PageElement, ICoordinate, ISerializable
Public Class Bookmark
    Inherits PageElement
    Implements ICoordinate, ISerializable

Inheritance: ObjectPageElementBookmark

Implements: ICoordinate, ISerializable

Licensing Info

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

Examples

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.
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
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
    public static void CreatePDF(string outputPath)
    {
        // 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(outputPath);
    }
}

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.

NOTE: This page element cannot be used within a table cell, or transformation group.

Constructors

Bookmark(String, Single, Single)Initializes a new instance of the Bookmark class.
Bookmark(String, Single, Single, Outline)Initializes a new instance of the Bookmark class.

Properties

ColorGets or sets the Color object to use for the text of the bookmark.
IDGets or sets the ID of the page element.
(Inherited from PageElement)
IgnoreMarginsGets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.
(Inherited from PageElement)
ParentOutlineGets or sets the Outline object the bookmark will appear under.
RelativeToGets and sets placement of the page element on the page.
(Inherited from PageElement)
StyleGets or sets the TextStyle enumeration that represents the text style of the bookmark.
TextGets or sets the text of the bookmark.
XGets of sets the X coordinate of the bookmark.
YGets or sets the Y coordinate of the bookmark.

Methods

Draw(PageWriter)Draws the bookmark to the given PageWriter object.
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.PageElements

In this topic