Products | Support | Email a link to this topic. | Send comments on this topic. | Back to Introduction - All Topics | Help Version 19.0.3.23
|
Leadtools.Pdf Assembly > Leadtools.Pdf Namespace > PDFFile Class : WriteBookmarks Method |
public void WriteBookmarks( IList<PDFBookmark> bookmarks, string destinationFileName )
'Declaration
Public Sub WriteBookmarks( _ ByVal bookmarks As IList(Of PDFBookmark), _ ByVal destinationFileName As String _ )
'Usage
Dim instance As PDFFile Dim bookmarks As IList(Of PDFBookmark) Dim destinationFileName As String instance.WriteBookmarks(bookmarks, destinationFileName)
public: void WriteBookmarks( IList<PDFBookmark>^ bookmarks, String^ destinationFileName )
You can use WriteBookmarks method to create a Table of Contents (TOC) for a PDF file. For more information, refer to PDFBookmark.
You can create a bookmarks list from scratch and populate with the bookmarks required, or you can read the bookmarks of a PDF file using PDFDocument.ParseDocumentStructure with the PDFParseDocumentStructureOptions.Bookmarks included in the options parameter. Modify these bookmarks then write them back to the file.
WriteBookmarks does not clear the existing bookmarks, only adds the new objects. To replace the bookmarks in an existing file with new ones, use ClearBookmarks first to delete any existing objects and then WriteBookmarks to add the new objects.
Note that ClearBookmarks will delete all existing bookmarks and any internal links found in the document.
For an example, refer to PDFDocument.ParseDocumentStructure.