In this page we want to introduce a new feature which allows you to create your own bookmark in a sophisticated yet intuitive way.
Supported by New Features
Since version 2.0.0.0 for .NET & version 1.5.0.0 for Java, we provide a set of APIs - CreateBookmarks and CreateBookmarkofPage - of Class PdfContentEditor which can create bookmark at a given page or all pages. Please follow these steps to create bookmarks into a PDF document:
Code Snippet
[C#]
// New a object of Class PdfContentEditor.
PdfContentEditor editor = new PdfContentEditor();
// Bind target pdf document .
editor.BindPdf("Aspose.Pdf.Kit.pdf");
// Create Bookmarks.
editor.CreateBookmarks();
//editor.CreateBookmarkofPage(“zuoke”,2);
// Save the result Pdf Document.
editor.Save(path+"createBookmarkofpage.pdf");
[VB]
' New a object of Class PdfContentEditor.
Dim editor As PdfContentEditor = New PdfContentEditor()
' Bind target pdf document .
editor.BindPdf("example1.pdf")
' Create Bookmarks.
editor.createBookmarks()
' Save the result Pdf Document.
editor.Save("example1_1.pdf")
[Java]
// New a object of Class PdfContentEditor.
PdfContentEditor editor = new PdfContentEditor();
// Bind target pdf document .
editor.bindPdf("example1.pdf");
// Create Bookmarks.
editor.createBookmarks();
//editor.createBookmarkOfPage("My2BookMark", 3);
// Save the result Pdf Document.
editor.save(path + "example1_pagebookmark.pdf");