Free Support Forum -

Problem with PDF Bookmarks

I used the sample code that was given to extract pdf bookmarks. It did not work. I got an error "Object reference not set to an instance of an object."

'create PdfBookmarkEditor
Dim bookmarkEditor As New PdfBookmarkEditor

'open PDF file


'extract bookmarks
Dim thebookmarks As Bookmarks

thebookmarks = bookmarkEditor.ExtractBookmarks()

NumberOfBookmarks = thebookmarks.Count

For Each bookmark As Bookmark In thebookmarks

Console.WriteLine("Title: {0}", bookmark.Title)

Console.WriteLine("Page Number: {0}", bookmark.PageNumber)

Next bookmark<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />


Hi Joseph,

Thanks for using our products.

Can you please share the source PDF document so that we can test the scenario at our end. We apologize for your inconvenience.