VintaSoft Imaging .NET SDK 14.1: Документация для .NET разработчика
Vintasoft.Imaging.Pdf.Tree Namespace / PdfBookmark Class / Title Property
Синтаксис Example Требования Смотрите также
    Title Свойство (PdfBookmark)
    Возвращает или задает текст, отображаемый на экране для этой закладки.
    Синтаксис
    'Declaration
    
    Public Property Title As System.String
    
    
     
    Пример

    Вот пример, показывающий, как изменить текст закладки PDF:

    ''' <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();
        }
    }
    
    

    Требования

    Целевые платформы: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также