Back to Devexpress

PdfBookmark.Title Property

officefileapi-devexpress-dot-pdf-dot-pdfbookmark-0c29cfdc.md

latest3.1 KB
Original Source

PdfBookmark.Title Property

Gets or sets the bookmark’s text on the navigation pane.

Namespace : DevExpress.Pdf

Assembly : DevExpress.Pdf.v25.2.Core.dll

NuGet Package : DevExpress.Pdf.Core

Declaration

csharp
public string Title { get; set; }
vb
Public Property Title As String

Property Value

TypeDescription
String

A String that is the text for a bookmark on the navigation pane.

|

Example

This example shows how to create bookmarks with destinations in code:

csharp
using DevExpress.Pdf;

using (PdfDocumentProcessor processor = new PdfDocumentProcessor())
{
    // Load a document
    processor.LoadDocument("..\\..\\Document.pdf");

    // Create destinations
    PdfDestination destination1 = processor.CreateDestination(1, 180, 150);
    PdfDestination destination2 = processor.CreateDestination(1, 168, 230);
    PdfDestination destination3 = processor.CreateDestination(1, 20, 350);

    // Associate bookmarks with created destinations
    processor.Document.Bookmarks.Add(new PdfBookmark()
         { Title = "PDF Document Processor", Destination = destination1 });
    processor.Document.Bookmarks.Add(new PdfBookmark()
         { Title = "Display, Print and Export PDF Documents", Destination = destination2 });
    processor.Document.Bookmarks.Add(new PdfBookmark()
         { Title = "Learn More", Destination = destination3 });

    // Save the result document
    processor.SaveDocument("..\\..\\Result.pdf");
}
vb
Imports DevExpress.Pdf

Using processor As New PdfDocumentProcessor()

    ' Load a document
    processor.LoadDocument("..\..\Document.pdf")

    ' Create destinations
    Dim destination1 As PdfDestination = processor.CreateDestination(1, 180, 150)
    Dim destination2 As PdfDestination = processor.CreateDestination(1, 168, 230)
    Dim destination3 As PdfDestination = processor.CreateDestination(1, 20, 350)

    ' Associate bookmarks with created destinations
    processor.Document.Bookmarks.Add(New PdfBookmark() With\
         {.Title = "PDF Document Processor", .Destination = destination1})
    processor.Document.Bookmarks.Add(New PdfBookmark() With
         {.Title = "Display, Print and Export PDF Documents", .Destination = destination2})
    processor.Document.Bookmarks.Add(New PdfBookmark() With
         {.Title = "Learn More", .Destination = destination3})

    ' Save the result document.
    processor.SaveDocument("..\..\Result.pdf")
End Using

See Also

PdfBookmark Class

PdfBookmark Members

DevExpress.Pdf Namespace