←Select platform

ClearBookmarks Method

Summary
Clears the bookmarks and internal links (TOC) from an existing PDF file.
Syntax
C#
C++/CLI
Java
Python
public void ClearBookmarks( 
   string destinationFileName 
) 
public void clearBookmarks( 
   java.lang.String string 
); 
public: 
void ClearBookmarks(  
   String^ destinationFileName 
)  
def ClearBookmarks(self,destinationFileName): 

Parameters

destinationFileName
Name of the destination PDF file to be created. If the value of this parameter is null then the filename set in FileName will be updated.

Remarks

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.

Requirements

Target Platforms

See Also

Reference

PDFFile Class

PDFFile Members

Help Version 22.0.2023.7.10
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Pdf Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.