大纲和书签
PDF 大纲或 "书签 "增加了一种导航到 PDF 关键页面的方法。在 Adobe Acrobat 阅读器中,这些书签 (可嵌套) 显示在应用程序的左侧边栏中。IronPDF 可从 PDF 文档中导入现有书签,并允许添加、编辑和嵌套更多书签。
using IronPdf; // Create a new PDF or edit an existing document. var pdf = PdfDocument.FromFile("existing.pdf"); // Add bookmark pdf.Bookmarks.AddBookMarkAtEnd("Author's Note", 2); pdf.Bookmarks.AddBookMarkAtEnd("Table of Contents", 3); // Store new bookmark in a variable to add nested bookmarks to var summaryBookmark = pdf.Bookmarks.AddBookMarkAtEnd("Summary", 17); // Add a sub-bookmark within the summary var conclusionBookmark = summaryBookmark.Children.AddBookMarkAtStart("Conclusion", 18); // Add another bookmark to end of highest-level bookmark list pdf.Bookmarks.AddBookMarkAtEnd("References", 20); // Remove bookmark example pdf.Bookmarks.RemoveBookMark(summaryBookmark); pdf.SaveAs("existing.pdf");
Imports IronPdf ' Create a new PDF or edit an existing document. Private pdf = PdfDocument.FromFile("existing.pdf") ' Add bookmark pdf.Bookmarks.AddBookMarkAtEnd("Author's Note", 2) pdf.Bookmarks.AddBookMarkAtEnd("Table of Contents", 3) ' Store new bookmark in a variable to add nested bookmarks to Dim summaryBookmark = pdf.Bookmarks.AddBookMarkAtEnd("Summary", 17) ' Add a sub-bookmark within the summary Dim conclusionBookmark = summaryBookmark.Children.AddBookMarkAtStart("Conclusion", 18) ' Add another bookmark to end of highest-level bookmark list pdf.Bookmarks.AddBookMarkAtEnd("References", 20) ' Remove bookmark example pdf.Bookmarks.RemoveBookMark(summaryBookmark) pdf.SaveAs("existing.pdf")
Install-Package IronPdf
PDF 大纲或 "书签 "增加了一种导航到 PDF 关键页面的方法。在 Adobe Acrobat 阅读器中,这些书签 (可嵌套) 显示在应用程序的左侧边栏中。IronPDF 可从 PDF 文档中导入现有书签,并允许添加、编辑和嵌套更多书签。