How to Remove Bookmark from PDF using C#

This how-to guide explains how to remove bookmark from PDF using C#. It provides detailed information about the configuration, a step-by-step program flow, and a runnable sample code to delete bookmarks in PDF using C#. It also discusses the deletion of selected bookmarks from the PDF file.

Steps to Remove Bookmark from PDF using C#

  1. Install Aspose.PDF for .NET from the repository to remove the bookmarks
  2. Load the PDF file into the Document class object to remove bookmarks
  3. Delete all the bookmarks in the PDF
  4. Save the resultant PDF file on the disk having no bookmarks

These steps describe the process of how to delete bookmarks in Adobe PDF using c#. The process is starting with loading the source PDF file into the Document class object and then calling the Document.Outlines.Delete() method to delete all the bookmarks in the PDF file. Once the bookmarks are deleted, the resultant PDF file is saved back on the disk.

Code to Remove Bookmarks in PDF using C#

This sample code demonstrates how to remove bookmarks from Adobe Acrobat using C#. It uses Document.Outlines.Delete() method to remove all the bookmarks from the PDF however you may use the other overload of the function that accepts the individual bookmark name that is to be deleted. In this case, you may call this method repetitively to delete a range of bookmarks if required.

This article has taught us how to delete bookmarks in PDF using C#. If you want to learn the process to read the bookmarks in a PDF file, refer to the article on how to read bookmarks in PDF using C#.

 English