We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

pdf.facade.PdfBookmarkEditor - extractBookmarks returns NullPointerException


We are using Java aspose.pdf for editing bookmarks. To retrieve bookmarks we are using code suggested at:

but it fails at below line:
//extract bookmarks

com.aspose.pdf.facades.Bookmarks bookmarks = bookmarkEditor.extractBookmarks();

at com.aspose.pdf.XYZExplicitDestination.getLeft(Unknown Source)
at com.aspose.pdf.facades.Bookmark.a(Unknown Source)
at com.aspose.pdf.facades.PdfBookmarkEditor.extractBookmarks(Unknown Source)

We want to use facades.Bookmarks extract method because we want to retrieve page display left,right etc. which is available only in facade.Bookmark class.

Test Pdf is attached. Please let us know what is the issue and how can we handle it so that we can use facades.Bookmarks.

Let us know alternative way to get bookmark ‘destination’ location/rectangle. i.e. the contents in pdf document to which the bookmark points.


Hi Sonali,

for using our products.<o:p></o:p>

I have tested the scenario and I am able to reproduce the same problem. For the sake of correction, I have logged it in our issue tracking system as PDFNEWJAVA-33691. We will investigate this issue in details and will keep you updated on the status of a correction.

We apologize for your inconvenience.

Hi Sonali,

Thanks for your patience. We have a good news for you, please note your above reported issue has been fixed in Aspose.Pdf for Java 9.7.0. Please download and try latest version of Aspose.Pdf for Java it will help you to accomplish the task.

Please feel free to contact us for any further assistance.

Best Regards,