Import and Export Bookmarks

Import Bookmarks from XML to an Existing PDF File

ImportBookmarksWithXml method allows you to import bookmarks into a PDF file from an XML file. In order to import the bookmarks, you need to create PdfBookmarkEditor object and bind the PDF file using BindPdf method. After that, you need to call ImportBookmarksWithXml method. Finally, save the updated PDF file using Save method. The following code snippet shows you how to import bookmarks from an XML file.

Export Bookmarks to XML from an Existing PDF File

The ExportBookmarksToXml method allows you to export bookmarks from a PDF file to an XML file.

To export bookmarks:

  1. Create a PdfBookmarkEditor object and bind the PDF file using the BindPdf method.
  2. Call the ExportBookmarksToXml method.
  3. Save the updated PDF file using the Save method.

The following code snippet shows you how to export bookmarks to an XML file.