Class PdfBookmarkEntry

Class PdfBookmarkEntry

Namespace: Aspose.Cells.Rendering
Assembly: Aspose.Cells.dll (25.2.0)

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.

public class PdfBookmarkEntry

Inheritance

objectPdfBookmarkEntry

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Examples

csharp
[C#]    
Workbook workbook = new Workbook();
workbook.Worksheets.Add();
workbook.Worksheets.Add();
Cell cellInPage1 = workbook.Worksheets[0].Cells["A1"];
Cell cellInPage2 = workbook.Worksheets[1].Cells["A1"];
Cell cellInPage3 = workbook.Worksheets[2].Cells["A1"];
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);

PdfSaveOptions saveOptions = new PdfSaveOptions();
saveOptions.Bookmark = pbeRoot;
workbook.Save("output_bookmark.pdf", saveOptions);

 [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("A1")
cellInPage1.PutValue("Page1")

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

cells = workbook.Worksheets(2).Cells
Dim cellInPage3 As Cell = cells("A1")
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)

Dim saveOptions As PdfSaveOptions = New PdfSaveOptions()
saveOptions.Bookmark = pbeRoot
workbook.Save("output_bookmark.pdf", saveOptions)

Constructors

PdfBookmarkEntry()

public PdfBookmarkEntry()

Properties

Destination

The cell to which the bookmark link.

public Cell Destination { get; set; }

Property Value

Cell

DestinationName

Gets or sets name of destination.

public string DestinationName { get; set; }

Property Value

string

Remarks

If destination name is set, the destination will be defined as a named destination with this name.

IsCollapse

When this property is true, the bookmarkentry will collapse, otherwise it will expand.

public bool IsCollapse { get; set; }

Property Value

bool

IsOpen

When this property is true, the bookmarkentry will expand, otherwise it will collapse.

public bool IsOpen { get; set; }

Property Value

bool

SubEntry

SubEntry of a bookmark.

public ArrayList SubEntry { get; set; }

Property Value

ArrayList

Text

Title of a bookmark.

public string Text { get; set; }

Property Value

string