PdfBookmarkEntry Class

PdfBookmarkEntry is an entry in pdf bookmark. if Text property of current instance is null or "", current instance will be hidden and children will be inserted on current level.
Inheritance Hierarchy
SystemObject
  Aspose.Cells.RenderingPdfBookmarkEntry

Namespace:  Aspose.Cells.Rendering
Assembly:  Aspose.Cells (in Aspose.Cells.dll) Version: 20.1.0.0 (20.1)
Syntax
public class PdfBookmarkEntry

The PdfBookmarkEntry type exposes the following members.

Constructors
  NameDescription
Public methodPdfBookmarkEntry
Initializes a new instance of the PdfBookmarkEntry class
Properties
  NameDescription
Public propertyDestination
The cell to which the bookmark link.
Public propertyDestinationName
Gets or sets name of destination.
Public propertyIsCollapse
When this property is true, the bookmarkentry will collapse, otherwise it will expand.
Public propertyIsOpen
When this property is true, the bookmarkentry will expand, otherwise it will collapse.
Public propertySubEntry
SubEntry of a bookmark.
Public propertyText
Title of a bookmark.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
 [C#]    
Workbook workbook = new Workbook();
workbook.Worksheets.Add();
workbook.Worksheets.Add();
Cell cellInPage1 = workbook.Worksheets[0].Cells["A0"];
Cell cellInPage2 = workbook.Worksheets[1].Cells["A0"];
Cell cellInPage3 = workbook.Worksheets[2].Cells["A0"];
cellInPage1.PutValue("page1");
cellInPage2.PutValue("page2");
cellInPage3.PutValue("page3");

PdfBookmarkEntry pbeRoot = new PdfBookmarkEntry();
pbeRoot.Text = "root";  // if pbeRoot.Text = null, all children of pbeRoot will be inserted on the top level in the bookmark.
pbeRoot.Destination = cellInPage1;
pbeRoot.SubEntry = new ArrayList();
pbeRoot.IsOpen = false;

PdfBookmarkEntry subPbe1 = new PdfBookmarkEntry();
subPbe1.Text = "section1";
subPbe1.Destination = cellInPage2;

PdfBookmarkEntry subPbe2 = new PdfBookmarkEntry();
subPbe2.Text = "section2";
subPbe2.Destination = cellInPage3;

pbeRoot.SubEntry.Add(subPbe1);
pbeRoot.SubEntry.Add(subPbe2);

workbook.SaveOptions.PdfBookmark = pbeRoot;
workbook.Save("c:\\Test.pdf");

 [VB]    
Dim workbook As Workbook = New Workbook
workbook.Worksheets.Add("sheet2")
workbook.Worksheets.Add("sheet3")

Dim cells As Cells = workbook.Worksheets(0).Cells
Dim cellInPage1 As Cell = cells("A0")
cellInPage1.PutValue("Page1")

cells = workbook.Worksheets(1).Cells
Dim cellInPage2 As Cell = cells("A0")
cellInPage2.PutValue("Page2")

cells = workbook.Worksheets(2).Cells
Dim cellInPage3 As Cell = cells("A0")
cellInPage3.PutValue("Page3")

Dim pbeRoot As PdfBookmarkEntry = New PdfBookmarkEntry()
pbeRoot.Text = "root"
pbeRoot.Destination = cellInPage1
pbeRoot.SubEntry = New ArrayList
pbeRoot.IsOpen = False

Dim subPbe1 As PdfBookmarkEntry = New PdfBookmarkEntry()
subPbe1.Text = "section1"
subPbe1.Destination = cellInPage2

Dim subPbe2 As PdfBookmarkEntry = New PdfBookmarkEntry()
subPbe2.Text = "section2"
subPbe2.Destination = cellInPage3

pbeRoot.SubEntry.Add(subPbe1)
pbeRoot.SubEntry.Add(subPbe2)

workbook.SaveOptions.PdfBookmark = pbeRoot
workbook.Save("c:\\Test.pdf")
See Also