Title Property (PdfBookmark)
Gets or sets the text to be displayed on the screen for this bookmark.
Here is an example that shows how to change text of PDF bookmark:
''' <summary>
''' Changes title of the first bookmark of PDF document.
''' </summary>
''' <param name="pdfFilename">The filename of PDF document.</param>
Public Shared Sub ChangeFirstBookmarkTitle(pdfFilename As String)
' open PDF document
Using document As New Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename)
' get the first bookmark of PDF document
Dim bookmark As Vintasoft.Imaging.Pdf.Tree.PdfBookmark = document.Bookmarks(0)
' change title of bookmark
bookmark.Title = "First bookmark"
' save changes to a file
document.SaveChanges()
End Using
End Sub
/// <summary>
/// Changes title of the first bookmark of PDF document.
/// </summary>
/// <param name="pdfFilename">The filename of PDF document.</param>
public static void ChangeFirstBookmarkTitle(string pdfFilename)
{
// open PDF document
using (Vintasoft.Imaging.Pdf.PdfDocument document =
new Vintasoft.Imaging.Pdf.PdfDocument(pdfFilename))
{
// get the first bookmark of PDF document
Vintasoft.Imaging.Pdf.Tree.PdfBookmark bookmark = document.Bookmarks[0];
// change title of bookmark
bookmark.Title = "First bookmark";
// save changes to a file
document.SaveChanges();
}
}
Target Platforms: .NET9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5