Import Bookmarks from XML to an Existing PDF File (facades)

[ ]

The importBookmarksWithXml method allows you to import bookmarks into a PDF file from an XML file.

To import bookmarks:

  1. Create a PdfBookmarkEditor object and bind the PDF file using the bindPdf method.
  2. Call the importBookmarksWithXml method.
  3. Save the updated PDF file using the save method.

The following code snippet shows how to import bookmarks from an XML file.

From Aspose.PDF for Java 9.0.0, the PdfBookmarkEditor class implements the exportBookmarksToXML and importBookmarksWithXML methods with Stream arguments. As a result, extracted bookmarks can be imported from a stream object.